Fossil Wrapper

Check-in [c4c35bb825]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:move pre-parsing of argv to separate proc.
Timelines: family | ancestors | descendants | both | dresden
Files: files | file ages | folders
SHA1: c4c35bb825a51ddde3d3d90c9dbae88538b6f4c6
User & Date: j 2013-07-28 12:49:37
Context
2013-07-28
13:16
moved interceptor related stuff to different position. check-in: ee3ce6f243 user: j tags: dresden
12:49
move pre-parsing of argv to separate proc. check-in: c4c35bb825 user: j tags: dresden
11:11
added handling of a `--debug n' option for controlling extend of debugging output. check-in: caa682962f user: j tags: dresden
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to fsl.

597
598
599
600
601
602
603

























604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
...
727
728
729
730
731
732
733
734

735
736
         regexp $rgxrev $line rev
         dict set revnums $rev [expr {$revcnt}]
      }
   } 

   return $revnums
}


























# --( Fossil )----------------------------------------------------------

proc fossil {args} {
    global dbglvl
    set dbglvl 0

    # check for presence of a `--debug n' option, if present, it
    # defines the debug level which controls how much additional
    # output is generated. after extraction of the debug level the
    # option and its value are eliminated from the argument string
    # since it otherwise would be interpreted as an (unknown) command
    # during further processing.

    set dbgpat {\--debug[[:blank:]]+([[:digit:]]+[ ]*)}
    regexp $dbgpat $args dum dbglvl
    regsub $dbgpat $args "" args

    set candidate [first $args]; # candidate for expansion

    if {$dbglvl > 0} { puts "*** provided argument list: $args" }

    # Alias expansion and command interception:
    set params [intercept [expand $args]]
................................................................................
    }

    log_user $prior_log;              # revert Expect settings
    return [spawned_errno $spawn_id]; # return with fossil error code
}

# --( Entry )-----------------------------------------------------------


config::init ~/.fslrc
exit [fossil {*}$argv]







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





<
<
<
<
<
<
<
<
<
<
<
<







 







<
>


597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633












634
635
636
637
638
639
640
...
740
741
742
743
744
745
746

747
748
749
         regexp $rgxrev $line rev
         dict set revnums $rev [expr {$revcnt}]
      }
   } 

   return $revnums
}

proc preparse argv {
   # purpose: preprocessing of provided argument string by looking
   # for `fsl' specific option/value arguments, which are eliminated
   # from the argv string after the corresponding actions are performed.
   # currently understands the following options:
   #
   #    --debug n : set global variable `dbglvl' to value n
   # -------------------------------------------------------------------
   global dbglvl
   set dbglvl 0
  
   # check for presence of a `--debug n' option, if present, it
   # defines the debug level which controls how much additional
   # output is generated. after extraction of the debug level the
   # option and its value are eliminated from the argument string
   # since it otherwise would be interpreted as an (unknown) command
   # during further processing.
  
   set dbgpat {\--debug[[:blank:]]+([[:digit:]]+[ ]*)}
   regexp $dbgpat $argv dum dbglvl
   regsub $dbgpat $argv "" argv

   return $argv
}

# --( Fossil )----------------------------------------------------------

proc fossil {args} {
    global dbglvl













    set candidate [first $args]; # candidate for expansion

    if {$dbglvl > 0} { puts "*** provided argument list: $args" }

    # Alias expansion and command interception:
    set params [intercept [expand $args]]
................................................................................
    }

    log_user $prior_log;              # revert Expect settings
    return [spawned_errno $spawn_id]; # return with fossil error code
}

# --( Entry )-----------------------------------------------------------

set argv [preparse $argv]
config::init ~/.fslrc
exit [fossil {*}$argv]