2
1
Fork 0

Adds docs for init

This commit is contained in:
sloum 2021-03-27 22:27:34 -07:00
parent 4379ef12de
commit 77de8e95af
4 changed files with 37 additions and 1 deletions

View File

@ -20,6 +20,12 @@ When viewing a story you will see the story title, when the story was last updat
![a screenshot of the story view of the application 'swim'](swim-story-view.png)
## Command Line Options
_swim_ has two command line flags: `-color` and `-h`. `-color` is detailed in its [own section](#colors) below. `-h` prints help text.
There is also one command line option or subcommand: `init`. Running `swim init` will create a swim file in the current working directory with three lanes (backlog, active, complete). The file will be named after the directory it is found in. So, if the working directory is `~/projects/myproject`, the file created will be `~/projects/myproject/myproject.swim`. This provides a quick way to get a board going without having to go through boilerplate steps. It is completely optional (it is not hard to build out a customized board).
### "Hot" Keys
These can be pressed at appropriate times to quickly control the board/program.

25
main.go
View File

@ -220,6 +220,7 @@ func InitNewBoard() {
filename = strings.Replace(filename, " ", "_", -1)
savepath := filepath.Join(workingPath, filename)
b.Write([]string{"write", savepath})
fmt.Printf("Swim file initialized: %s", savepath)
Quit()
}
@ -253,7 +254,31 @@ func SetColorFromFlag(f string) int {
}
}
func printHelp() {
header := `swim - project board
Syntax: swim [flags] [option or filepath]
Examples:
swim
swim -h
swim init
swim ./my-board.swim
swim -color true ./my-board.swim
Options:
init
initialize a board with three default lanes
Flags:
`
_, _ = fmt.Fprintf(os.Stdout, header)
flag.PrintDefaults()
}
func main() {
flag.Usage = printHelp
colors := flag.String("color", "", "Color mode: Simple, 256, True, None" )
flag.Parse()
args := flag.Args()

7
swim.1
View File

@ -4,7 +4,7 @@
.SH SYNOPSIS
.nf
.fam C
\fBswim\fP [\fIoptions\fP] [\fIfilepath\fP]
\fBswim\fP [\fIoptions\fP] [\fIsubcommand|filepath\fP]
.fam T
.fi
.SH DESCRIPTION
@ -16,6 +16,11 @@
.B
\fB-h\fP
Display usage help and exit.
.SH SUBCOMMANDS
.TP
.B
init
Creates a default board with three lanes (backlog, active, and complete). The file will be based on the name of the current directory such that running \fIswim init\fP in \fI~/my-project\fP would produce \fI~/my-project/my-project.swim\fP.
.TP
.B
\fB-color\fP