Fossil

Check-in [42d6c86f]
Login

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

Overview
Comment:Add script to automate updating common command list in man page, and use it to update the man page
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:42d6c86fa1f2077218693f952a5a4a2dc539e072
User & Date: andygoth 2016-11-15 02:50:08
Context
2016-11-15
22:49
Avoid listing added files when running "fossil changes -edited" check-in: 0dea016d user: andygoth tags: trunk
21:47
Change the /test-version webpage into a supported /version webpage. Add a link from /stat. Closed-Leaf check-in: 57fea315 user: drh tags: stat-update
02:50
Add script to automate updating common command list in man page, and use it to update the man page check-in: 42d6c86f user: andygoth tags: trunk
00:30
Fix timeline -n 0 to display an unlimited number of lines (rather than zero) to match documentation. Correct timeline -n for negative N documentation to match actual behavior. Limit compute_ancestors() and compute_descendants() on the assumption that there is no more than one entry per line. check-in: def9af43 user: andygoth tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to fossil.1.

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
\fICOMMAND [OPTIONS]\fR
.SH DESCRIPTION
Fossil is a distributed version control system (DVCS) with built-in
wiki, ticket tracker, CGI/http interface, and http server.

.SH Common COMMANDs:

add            clean          import         pull           stash
.br
addremove      clone          info           purge          status
.br
all            commit         init           push           sync
.br
annotate       diff           json           rebuild        tag
.br
bisect         export         ls             remote-url     timeline
.br
blame          extras         merge          revert         ui
.br
branch         finfo          mv             rm             undo
.br
bundle         fusefs         open           rss            unpublish
.br
cat            gdiff          praise         settings       update
.br
changes        help           publish        sqlite3        version

.SH FEATURES

Features as described on the fossil home page.

.HP
1.







|

|

|

|

|

|

|

|

|

|







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
\fICOMMAND [OPTIONS]\fR
.SH DESCRIPTION
Fossil is a distributed version control system (DVCS) with built-in
wiki, ticket tracker, CGI/http interface, and http server.

.SH Common COMMANDs:

add            changes        gdiff          publish        status
.br
addremove      clean          help           pull           sync
.br
all            clone          import         push           tag
.br
amend          commit         info           rebuild        timeline
.br
annotate       delete         init           remote-url     ui
.br
bisect         diff           ls             revert         undo
.br
blame          export         merge          rm             unpublished
.br
branch         extras         mv             settings       unversioned
.br
bundle         finfo          open           sqlite3        update
.br
cat            fusefs         praise         stash          version

.SH FEATURES

Features as described on the fossil home page.

.HP
1.

Added tools/man_page_command_list.tcl.









































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
#!/usr/bin/env tclsh
# command_man_list.tcl - generates common command list for fossil.1

# Tunable configuration.
set columns 5
set width 15

# The only supported command-line argument is the optional output filename.
if {[llength $argv] == 1} {
    set file [lindex $argv 0]
}

# Get list of common commands.
set commands [exec fossil help]
regsub -nocase {.*?\ncommon commands:.*\n} $commands {} commands
regsub -nocase {\nthis is fossil version.*} $commands {} commands
regsub -all {\s+} $commands " " commands
set commands [lsort $commands]

# Compute number of rows.
set rows [expr {([llength $commands] + $columns - 1) / $columns}]

# Generate text one line at a time.
set text {}
for {set row 0} {$row < $rows} {incr row} {
    # Separate rows with line break.
    if {$row} {
        append text .br\n
    }

    # Generate the row of commands.
    for {set col 0} {$col < $columns} {incr col} {
        set i [expr {$col * $rows + $row}]
        if {$i < [llength $commands]} {
            append text [format %-*s $width [lindex $commands $i]]
        }
    }
    append text \n
}

# Strip trailing whitespace from each line.
regsub -all {\s+\n} $text \n text

# Output text.
if {[info exists file]} {
    # If a filename was specified, read the file for use as a template.
    set chan [open $file]
    set data [read $chan]
    close $chan

    # Locate the part of the file to replace.
    if {[regexp -indices {\n\.SH Common COMMANDs:\n\n(.*?)\n\.SH} $data\
            _ range]} {
        # If found, replace with the updated command list.
        set chan [open $file w]
        puts -nonewline $chan [string replace $data\
                [lindex $range 0] [lindex $range 1] $text]
        close $chan
    } else {
        # If not found, abort.
        error "could not find command list in man file \"$file\""
    }
} else {
    # If no filename was specified, write to stdout.
    puts $text
}

# vim: set sts=4 sw=4 tw=80 et ft=tcl: