summaryrefslogtreecommitdiffstats
path: root/tcllib/support/devel/sak/help/cmd.tcl
blob: 8fe5f8ef249ac93a601ed1c2ba8fe34e0eff50d6 (plain)
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
# -*- tcl -*-
# Implementation of 'help'.

# Available variables
# * argv  - Cmdline arguments

if {[llength $argv] > 2} {
    puts stderr "Usage: $argv0 help ?topic?"
    exit 1
}

package require sak::help

if {[llength $argv] == 1} {
    # Argument is a topic.
    # Locate text for the topic.

    sak::help::print [sak::help::on [lindex $argv 0]]
    return
}

sak::help::print [sak::help::alltopics]

##
# ###