|
|
|
|
@ -83,34 +83,38 @@ namespace eval punk::repo {
|
|
|
|
|
|
|
|
|
|
proc get_fossil_usage {} { |
|
|
|
|
set allcmds [runout -n fossil help -a] |
|
|
|
|
set allcmds [punk::ansi::ansistrip $allcmds] |
|
|
|
|
set mainhelp [runout -n fossil help] |
|
|
|
|
set mainhelp [punk::ansi::ansistrip $mainhelp] |
|
|
|
|
set maincommands [list] |
|
|
|
|
|
|
|
|
|
#only start parsing for TOPICS after a line such as "Other comman values for TOPIC:" |
|
|
|
|
set parsing_topics 0 |
|
|
|
|
foreach ln [split $mainhelp \n] { |
|
|
|
|
set ln [string trim $ln] |
|
|
|
|
if {$ln eq ""} { |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
if {[string match "*values for TOPIC*" $ln]} { |
|
|
|
|
set parsing_topics 1 |
|
|
|
|
if {$ln eq ""} { |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
if {[string match "*values for TOPIC*" $ln]} { |
|
|
|
|
set parsing_topics 1 |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
if {$parsing_topics} { |
|
|
|
|
#lines starting with uppercase are topic headers - we want to ignore these and any blank lines |
|
|
|
|
if {[regexp {^[A-Z]+} $ln]} { |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
if {$parsing_topics} { |
|
|
|
|
#lines starting with uppercase are topic headers - we want to ignore these and any blank lines |
|
|
|
|
if {[regexp {^[A-Z]+} $ln]} { |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
lappend maincommands {*}$ln |
|
|
|
|
} |
|
|
|
|
lappend maincommands {*}$ln |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#fossil output was ordered in columns, but we loaded list in row-wise, messing up the order |
|
|
|
|
set maincommands [lsort $maincommands] |
|
|
|
|
set allcmds [lsort $allcmds] |
|
|
|
|
set othercmds [punk::lib::ldiff $allcmds $maincommands] |
|
|
|
|
|
|
|
|
|
set fossil_setting_names [lsort [runout -n fossil help -s]] |
|
|
|
|
set setting_info [runout -n fossil help -s] |
|
|
|
|
set setting_info [punk::ansi::ansistrip $setting_info] |
|
|
|
|
set fossil_setting_names [lsort $setting_info] |
|
|
|
|
|
|
|
|
|
set result "@leaders -min 0\n" |
|
|
|
|
|
|
|
|
|
@ -186,6 +190,8 @@ namespace eval punk::repo {
|
|
|
|
|
|
|
|
|
|
foreach ln $basic_opt_lines { |
|
|
|
|
set ln [string trim $ln] |
|
|
|
|
#fossil sometimes emits cursor control sequences e.g CSI 3 q |
|
|
|
|
set ln [punk::ansi::ansistrip $ln] |
|
|
|
|
if {$ln eq ""} { |
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
@ -250,6 +256,7 @@ namespace eval punk::repo {
|
|
|
|
|
${[punk::repo::get_fossil_subcommand_usage add]} |
|
|
|
|
|
|
|
|
|
@form -form "raw" -synopsis "exec fossil add \[OPTIONS\] FILE1 \[FILE2\]..." |
|
|
|
|
#fossil help may have ansi - review |
|
|
|
|
@formdisplay -header "fossil help add" -body {${[runout -n fossil help add]}} |
|
|
|
|
} ""] |
|
|
|
|
|
|
|
|
|
@ -264,6 +271,7 @@ namespace eval punk::repo {
|
|
|
|
|
${[punk::repo::get_fossil_subcommand_usage diff]} |
|
|
|
|
|
|
|
|
|
@form -form "raw" -synopsis "exec fossil diff \[OPTIONS\] FILE1 \[FILE2\]..." |
|
|
|
|
#fossil help may have ansi - review |
|
|
|
|
@formdisplay -header "fossil help diff" -body {${[runout -n fossil help diff]}} |
|
|
|
|
} ""] |
|
|
|
|
|
|
|
|
|
|