about summary refs log tree commit diff stats
Commit message (Expand)AuthorAgeFilesLines
...
* several other additions/fixes, dwm is quite usable alreadyAnselm R. Garbe2006-07-134-111/+165
* implemented tagging a clientAnselm R. Garbe2006-07-135-85/+156
* several fixesAnselm R. Garbe2006-07-132-4/+4
* added philosophy sectionAnselm R. Garbe2006-07-131-0/+11
* added xlock command (I need it regularly)Anselm R. Garbe2006-07-134-25/+19
* added pointer warps on kb-driven/manage-driven focusAnselm R. Garbe2006-07-131-0/+3
* changed back to urxvt, dwm has no problems with it, because it doesn't use fr...Anselm R. Garbe2006-07-132-2/+2
* changed default colorsAnselm R. Garbe2006-07-138-82/+71
* added dev.c instead of kb.cAnselm R. Garbe2006-07-135-66/+57
* removed obsolete stuffAnselm R. Garbe2006-07-131-13/+12
* fixed grammar bug reported by John-GaltAnselm R. Garbe2006-07-131-1/+1
* another changeAnselm R. Garbe2006-07-131-1/+1
* updated man pageAnselm R. Garbe2006-07-131-7/+5
* small changes to READMEAnselm R. Garbe2006-07-131-3/+3
* last change to dwm.htmlAnselm R. Garbe2006-07-131-43/+47
* renamed/changedAnselm R. Garbe2006-07-132-1/+1
* added logo+descriptionAnselm R. Garbe2006-07-1312-115/+194
* new stuff (some warning elimination)Anselm R. Garbe2006-07-137-47/+44
* removed unnecessary crapAnselm R. Garbe2006-07-1315-785/+95
* before leaning things upAnselm R. Garbe2006-07-139-112/+150
* new stuff, fixed several issuesAnselm R. Garbe2006-07-126-12/+13
* added gravity stuffAnselm R. Garbe2006-07-124-7/+76
* added maxAnselm R. Garbe2006-07-123-3/+15
* added grid mode on Mod1Mask gAnselm R. Garbe2006-07-127-66/+97
* simplified several portions of code through replacing rect structs with x,y,h...Anselm R. Garbe2006-07-1212-235/+164
* fixed configurerequestAnselm R. Garbe2006-07-121-1/+1
* new colorsAnselm R. Garbe2006-07-121-3/+3
* some more additions/fixesAnselm R. Garbe2006-07-125-3/+32
* fixed several other stuff, coming closer to something usefulAnselm R. Garbe2006-07-115-15/+23
* implemented draw_client stuffAnselm R. Garbe2006-07-113-20/+58
* made code more readableAnselm R. Garbe2006-07-115-70/+67
* added basic mouse support (actually we don't need more)Anselm R. Garbe2006-07-114-24/+15
* added mouse-based resizalsAnselm R. Garbe2006-07-117-19/+181
* updated READMEAnselm R. Garbe2006-07-111-5/+15
* several changes, new stuffAnselm R. Garbe2006-07-117-19/+34
* removed unnecessary sel stuffAnselm R. Garbe2006-07-114-95/+2
* added bar event timerAnselm R. Garbe2006-07-119-51/+87
* added protocol killing stuffAnselm R. Garbe2006-07-116-36/+153
* new stuffAnselm R. Garbe2006-07-111-0/+20
* added gridsel to gridwmAnselm R. Garbe2006-07-117-13/+99
* changed how manage client worksAnselm R. Garbe2006-07-114-29/+44
* fixed several stuff (gridwm gets better and better)Anselm R. Garbe2006-07-1110-141/+59
* added key handlingAnselm R. Garbe2006-07-115-30/+44
* new stuffAnselm R. Garbe2006-07-115-32/+25
* implemented pipe_spawnAnselm R. Garbe2006-07-117-15/+70
* added several other stuffAnselm R. Garbe2006-07-1012-39/+476
* renamed gridmenu.c into menu.cAnselm R. Garbe2006-07-102-1/+1
* several new changes, made gridmenu workingAnselm R. Garbe2006-07-109-206/+256
* added new stuffAnselm R. Garbe2006-07-1011-36/+328
* added gridmenuAnselm R. Garbe2006-07-103-3/+617
Nim/blame/compiler/nim.nim?h=devel&id=423e8cca91d06983fd0bd65419c00a6ae6da2d80'>^
f115e40e6 ^
18a3833d6 ^




d55cc0888 ^
206a4cee7 ^
18a3833d6 ^

73c306258 ^
52829fc8d ^
18a3833d6 ^

342e50e26 ^
ed0cb7b85 ^

349217849 ^
ed0cb7b85 ^

73919e308 ^
7072e3ddc ^
ed0cb7b85 ^


349217849 ^
7815ed69d ^
c1664f93b ^
349217849 ^
bd90199a2 ^
ed0cb7b85 ^


52829fc8d ^
93cd98dd1 ^
ed0cb7b85 ^
dda6f3f6d ^
dda6f3f6d ^
52829fc8d ^
9502e39b6 ^


a4e6b242d ^



9502e39b6 ^
a4e6b242d ^

9502e39b6 ^
a4e6b242d ^
52829fc8d ^
dda6f3f6d ^



dda6f3f6d ^


e25474154 ^
dd806cafa ^
4aba7421f ^
65fdd641a ^
3d7abb958 ^
65fdd641a ^

1e26047c3 ^

342e50e26 ^

7349d12e9 ^

342e50e26 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128

 
                            
                                         




                                                   

                                       
                                
       
                                   
 
                                                          
                                                
                                                         
                                               
 
      


                                         
                         
 
                                           
                             
 


                     
                                               

                                             
 


                                                                         



                                                              



                    
                                     
                                

                                                                             

                                  
                                               
 
                                                                        




                                                             
                                
                                             

                                                           
                                                                 
                                                                                      

                                                            
                                                        

                            
                                  

                                            
                       
                               


                                         
                                         
                                                               
          
                    
                                                        


                                   
                          
                                      
                                  
                                
                 
                           


                                                   



                                                                                                       
                                         

                                                                         
                                                                                     
                                                                                             
                                                                            



                                                                                   


                                                                             
 
                              
                      
 
                                                              

                                                        

                           

                                      

                                
                                      
#
#
#           The Nim Compiler
#        (c) Copyright 2015 Andreas Rumpf
#
#    See the file "copying.txt", included in this
#    distribution, for details about the copyright.
#

when defined(gcc) and defined(windows):
  when defined(x86):
    {.link: "../icons/nim.res".}
  else:
    {.link: "../icons/nim_icon.o".}

when defined(amd64) and defined(windows) and defined(vcc):
  {.link: "../icons/nim-amd64-windows-vcc.res".}
when defined(i386) and defined(windows) and defined(vcc):
  {.link: "../icons/nim-i386-windows-vcc.res".}

import
  commands, options, msgs,
  extccomp, strutils, os, main, parseopt,
  idents, lineinfos, cmdlinehelper,
  pathutils, modulegraphs

from std/browsers import openDefaultBrowser
from nodejs import findNodeJs

when hasTinyCBackend:
  import tccgen

when defined(profiler) or defined(memProfiler):
  {.hint: "Profiling support is turned on!".}
  import nimprof

proc processCmdLine(pass: TCmdLinePass, cmd: string; config: ConfigRef) =
  var p = parseopt.initOptParser(cmd)
  var argsCount = 0

  config.commandLine.setLen 0
    # bugfix: otherwise, config.commandLine ends up duplicated

  while true:
    parseopt.next(p)
    case p.kind
    of cmdEnd: break
    of cmdLongOption, cmdShortOption:
      config.commandLine.add " "
      config.commandLine.addCmdPrefix p.kind
      config.commandLine.add p.key.quoteShell # quoteShell to be future proof
      if p.val.len > 0:
        config.commandLine.add ':'
        config.commandLine.add p.val.quoteShell

      if p.key == "": # `-` was passed to indicate main project is stdin
        p.key = "-"
        if processArgument(pass, p, argsCount, config): break
      else:
        processSwitch(pass, p, config)
    of cmdArgument:
      config.commandLine.add " "
      config.commandLine.add p.key.quoteShell
      if processArgument(pass, p, argsCount, config): break
  if pass == passCmd2:
    if {optRun, optWasNimscript} * config.globalOptions == {} and
        config.arguments.len > 0 and config.cmd notin {cmdTcc, cmdNimscript, cmdCrun}:
      rawMessage(config, errGenerated, errArgsNeedRunOption)

proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =
  let self = NimProg(
    supportsStdinFile: true,
    processCmdLine: processCmdLine
  )
  self.initDefinesProg(conf, "nim_compiler")
  if paramCount() == 0:
    writeCommandLineUsage(conf)
    return

  self.processCmdLineAndProjectPath(conf)
  var graph = newModuleGraph(cache, conf)
  if not self.loadConfigsAndProcessCmdLine(cache, conf, graph):
    return
  mainCommand(graph)
  if conf.hasHint(hintGCStats): echo(GC_getStatistics())
  #echo(GC_getStatistics())
  if conf.errorCounter != 0: return
  when hasTinyCBackend:
    if conf.cmd == cmdTcc:
      tccgen.run(conf, conf.arguments)
  if optRun in conf.globalOptions:
    let output = conf.absOutFile
    case conf.cmd
    of cmdBackends, cmdTcc:
      var cmdPrefix = ""
      case conf.backend
      of backendC, backendCpp, backendObjc: discard
      of backendJs:
        # D20210217T215950:here this flag is needed for node < v15.0.0, otherwise
        # tasyncjs_fail` would fail, refs https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode
        cmdPrefix = findNodeJs() & " --unhandled-rejections=strict "
      else: doAssert false, $conf.backend
      # No space before command otherwise on windows you'd get a cryptic:
      # `The parameter is incorrect`
      execExternalProgram(conf, cmdPrefix & output.quoteShell & ' ' & conf.arguments)
      # execExternalProgram(conf, cmdPrefix & ' ' & output.quoteShell & ' ' & conf.arguments)
    of cmdDocLike, cmdRst2html, cmdRst2tex: # bugfix(cmdRst2tex was missing)
      if conf.arguments.len > 0:
        # reserved for future use
        rawMessage(conf, errGenerated, "'$1 cannot handle arguments" % [$conf.cmd])
      openDefaultBrowser($output)
    else:
      # support as needed
      rawMessage(conf, errGenerated, "'$1 cannot handle --run" % [$conf.cmd])

when declared(GC_setMaxPause):
  GC_setMaxPause 2_000

when compileOption("gc", "v2") or compileOption("gc", "refc"):
  # the new correct mark&sweet collector is too slow :-/
  GC_disableMarkAndSweep()

when not defined(selftest):
  let conf = newConfigRef()
  handleCmdLine(newIdentCache(), conf)
  when declared(GC_setMaxPause):
    echo GC_getStatistics()
  msgQuit(int8(conf.errorCounter > 0))