From d4d8ce2b43c02897bf9b6358d95788b3359be549 Mon Sep 17 00:00:00 2001 From: toshi0383 Date: Fri, 16 Feb 2018 21:44:14 +0900 Subject: [PATCH 1/8] Add man-page for blob --- Sources/cmdshelf/Arguments.swift | 2 +- doc/man/man1/cmdshelf-blob.1 | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 doc/man/man1/cmdshelf-blob.1 diff --git a/Sources/cmdshelf/Arguments.swift b/Sources/cmdshelf/Arguments.swift index 84eed1d..cc8ed5b 100644 --- a/Sources/cmdshelf/Arguments.swift +++ b/Sources/cmdshelf/Arguments.swift @@ -14,7 +14,7 @@ enum SubCommand: String { case run, list, remote, blob, cat, update, help var possiblyHasManPage: Bool { - return [.list].contains(self) + return [.blob, .list].contains(self) } } diff --git a/doc/man/man1/cmdshelf-blob.1 b/doc/man/man1/cmdshelf-blob.1 new file mode 100644 index 0000000..941420d --- /dev/null +++ b/doc/man/man1/cmdshelf-blob.1 @@ -0,0 +1,15 @@ +.TH "CMDSHELF-BLOB" "1" "February 2018" "cmdshelf 0.9.3" "Cmdshelf Manual" +.SH "NAME" +cmdshelf-blob - Manage blobs +.SH "SYNOPSIS" +\fIcmdshelf blob\fR [] +.SH "DESCRIPTION" +.TP +The blob subcommand manages blobs. +.SH "SUB-COMMANDS" +.SS add +Add a blob named at . can be a network URL or a local filepath. +.SS list +List blobs. +.SS remove +Remove the blob named . From 9dafd68ae72d616fe05c71492adb251db6c26313 Mon Sep 17 00:00:00 2001 From: toshi0383 Date: Fri, 16 Feb 2018 21:58:35 +0900 Subject: [PATCH 2/8] Add man-page for cat --- Sources/cmdshelf/Arguments.swift | 4 ++-- doc/man/man1/cmdshelf-cat.1 | 8 ++++++++ doc/man/man1/cmdshelf.1 | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 doc/man/man1/cmdshelf-cat.1 diff --git a/Sources/cmdshelf/Arguments.swift b/Sources/cmdshelf/Arguments.swift index cc8ed5b..722ddcc 100644 --- a/Sources/cmdshelf/Arguments.swift +++ b/Sources/cmdshelf/Arguments.swift @@ -11,10 +11,10 @@ struct Alias { enum SubCommand: String { - case run, list, remote, blob, cat, update, help + case blob, cat, list, remote, run, update var possiblyHasManPage: Bool { - return [.blob, .list].contains(self) + return [.blob, .cat, .list].contains(self) } } diff --git a/doc/man/man1/cmdshelf-cat.1 b/doc/man/man1/cmdshelf-cat.1 new file mode 100644 index 0000000..fa797b8 --- /dev/null +++ b/doc/man/man1/cmdshelf-cat.1 @@ -0,0 +1,8 @@ +.TH "CMDSHELF-CAT" "1" "February 2018" "cmdshelf 0.9.3" "Cmdshelf Manual" +.SH "NAME" +cmdshelf-cat - Concatenate and print command(s). +.SH "SYNOPSIS" +\fIcmdshelf cat\fR [[:]] +.SH "DESCRIPTION" +.TP +The cat subcommand reads commands script files sequentially, writing them to the standard output. diff --git a/doc/man/man1/cmdshelf.1 b/doc/man/man1/cmdshelf.1 index 1ec1f96..6998e18 100644 --- a/doc/man/man1/cmdshelf.1 +++ b/doc/man/man1/cmdshelf.1 @@ -13,7 +13,7 @@ to see more detailed manual page for each sub-command. .SS blob Manage blob commands. .SS cat -Concatenate and print sourcecodes of commands. +Concatenate and print command(s). .SS help Show help message. .SS list From 69154964e2d4a1f8d9fe33a50d6efcf58d47eefa Mon Sep 17 00:00:00 2001 From: toshi0383 Date: Fri, 16 Feb 2018 22:08:50 +0900 Subject: [PATCH 3/8] Add man-page for remote --- Sources/cmdshelf/Arguments.swift | 2 +- doc/man/man1/cmdshelf-remote.1 | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 doc/man/man1/cmdshelf-remote.1 diff --git a/Sources/cmdshelf/Arguments.swift b/Sources/cmdshelf/Arguments.swift index 722ddcc..37d8eba 100644 --- a/Sources/cmdshelf/Arguments.swift +++ b/Sources/cmdshelf/Arguments.swift @@ -14,7 +14,7 @@ enum SubCommand: String { case blob, cat, list, remote, run, update var possiblyHasManPage: Bool { - return [.blob, .cat, .list].contains(self) + return [.blob, .cat, .list, .remote].contains(self) } } diff --git a/doc/man/man1/cmdshelf-remote.1 b/doc/man/man1/cmdshelf-remote.1 new file mode 100644 index 0000000..c6dbfc7 --- /dev/null +++ b/doc/man/man1/cmdshelf-remote.1 @@ -0,0 +1,15 @@ +.TH "CMDSHELF-REMOTE" "1" "February 2018" "cmdshelf 0.9.3" "Cmdshelf Manual" +.SH "NAME" +cmdshelf-remote - Manage set of tracked repositories +.SH "SYNOPSIS" +\fIcmdshelf remote\fR [] +.SH "DESCRIPTION" +.TP +Manage the set of repositories ("remotes"). +.SH "SUB-COMMANDS" +.SS add +Adds a remote named for the repository at . +.SS list +List tracked remotes. +.SS remove +Remove the remote named . This won't remove the cloned local repository. Clean on your own if needed. From a63875881c37da9ea8ff616449487e9d4b6092b0 Mon Sep 17 00:00:00 2001 From: toshi0383 Date: Fri, 16 Feb 2018 22:16:15 +0900 Subject: [PATCH 4/8] Add man-page for run --- Sources/cmdshelf/Arguments.swift | 2 +- doc/man/man1/cmdshelf-run.1 | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 doc/man/man1/cmdshelf-run.1 diff --git a/Sources/cmdshelf/Arguments.swift b/Sources/cmdshelf/Arguments.swift index 37d8eba..4c7692a 100644 --- a/Sources/cmdshelf/Arguments.swift +++ b/Sources/cmdshelf/Arguments.swift @@ -14,7 +14,7 @@ enum SubCommand: String { case blob, cat, list, remote, run, update var possiblyHasManPage: Bool { - return [.blob, .cat, .list, .remote].contains(self) + return [.blob, .cat, .list, .remote, .run].contains(self) } } diff --git a/doc/man/man1/cmdshelf-run.1 b/doc/man/man1/cmdshelf-run.1 new file mode 100644 index 0000000..30916f0 --- /dev/null +++ b/doc/man/man1/cmdshelf-run.1 @@ -0,0 +1,13 @@ +.TH "CMDSHELF-RUN" "1" "February 2018" "cmdshelf 0.9.3" "Cmdshelf Manual" +.SH "NAME" +cmdshelf-run - Execute command +.SH "SYNOPSIS" +\fIcmdshelf run\fR [:] [] +.SH "DESCRIPTION" +.TP +The run subcommand receives command-alias and whitespace separated list of parameters. +.SH "AVOIDING NAMESPACE CONFLICT" +.TP + +The \fIrun\fR subcommand picks up first command matches the . If you have same command names from different remotes, add \fI:\fR prefix to to be explicit. + e.g. cmdshelf run myRemote:echo-sd hello From 8014f447b362d621ab09157d2240329ffca561c5 Mon Sep 17 00:00:00 2001 From: toshi0383 Date: Fri, 16 Feb 2018 22:17:37 +0900 Subject: [PATCH 5/8] fix --- Sources/cmdshelf/Arguments.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/cmdshelf/Arguments.swift b/Sources/cmdshelf/Arguments.swift index 4c7692a..cc211ca 100644 --- a/Sources/cmdshelf/Arguments.swift +++ b/Sources/cmdshelf/Arguments.swift @@ -11,10 +11,10 @@ struct Alias { enum SubCommand: String { - case blob, cat, list, remote, run, update + case blob, cat, help, list, remote, run, update var possiblyHasManPage: Bool { - return [.blob, .cat, .list, .remote, .run].contains(self) + return [.blob, .cat, .list, .help, .remote, .run].contains(self) } } From 7bba870c9bd413d9149d00d137477858d3fef107 Mon Sep 17 00:00:00 2001 From: toshi0383 Date: Fri, 16 Feb 2018 22:24:10 +0900 Subject: [PATCH 6/8] Add man-page for update --- Sources/cmdshelf/Arguments.swift | 4 ---- Sources/cmdshelf/Commands.swift | 6 +----- doc/man/man1/cmdshelf-update.1 | 8 ++++++++ 3 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 doc/man/man1/cmdshelf-update.1 diff --git a/Sources/cmdshelf/Arguments.swift b/Sources/cmdshelf/Arguments.swift index cc211ca..0735843 100644 --- a/Sources/cmdshelf/Arguments.swift +++ b/Sources/cmdshelf/Arguments.swift @@ -12,10 +12,6 @@ struct Alias { enum SubCommand: String { case blob, cat, help, list, remote, run, update - - var possiblyHasManPage: Bool { - return [.blob, .cat, .list, .help, .remote, .run].contains(self) - } } // - MARK: ArgumentParser diff --git a/Sources/cmdshelf/Commands.swift b/Sources/cmdshelf/Commands.swift index 3e438cd..e4a0304 100644 --- a/Sources/cmdshelf/Commands.swift +++ b/Sources/cmdshelf/Commands.swift @@ -107,11 +107,7 @@ final class HelpCommand: Command { return } let subCommand = try SubCommandArgument().parse(parser) - if subCommand.possiblyHasManPage { - if spawnPager(cmdString: "man cmdshelf-\(subCommand.rawValue)") != 0 { - queuedPrintln(subCommand.helpMessage) - } - } else { + if spawnPager(cmdString: "man cmdshelf-\(subCommand.rawValue)") != 0 { queuedPrintln(subCommand.helpMessage) } } diff --git a/doc/man/man1/cmdshelf-update.1 b/doc/man/man1/cmdshelf-update.1 new file mode 100644 index 0000000..a01c462 --- /dev/null +++ b/doc/man/man1/cmdshelf-update.1 @@ -0,0 +1,8 @@ +.TH "CMDSHELF-UPDATE" "1" "February 2018" "cmdshelf 0.9.3" "Cmdshelf Manual" +.SH "NAME" +cmdshelf-update - Update cloned local repositories. +.SH "SYNOPSIS" +\fIcmdshelf update\fR +.SH "DESCRIPTION" +.TP +The \fIupdate\fR subcommand updates each cloned repositories. From 8b876a3e167ed2e9a43e426942c578475e02e647 Mon Sep 17 00:00:00 2001 From: toshi0383 Date: Fri, 16 Feb 2018 22:26:22 +0900 Subject: [PATCH 7/8] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb0f89a..458e6cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## master ##### Enhancement +* Add missing man-pages [#67](https://github.com/toshi384/cmdshelf/pull/67) + [Toshihiro Suzuki](https://github.com/toshi0383) + * Use $PAGER for spawning man-page process if specified [#66](https://github.com/toshi384/cmdshelf/pull/66) [Toshihiro Suzuki](https://github.com/toshi0383) From a9c5439e492d85675b1062f38ffd07d99b59f4f8 Mon Sep 17 00:00:00 2001 From: toshi0383 Date: Fri, 16 Feb 2018 22:36:30 +0900 Subject: [PATCH 8/8] bold --- doc/man/man1/cmdshelf-blob.1 | 2 +- doc/man/man1/cmdshelf-cat.1 | 2 +- doc/man/man1/cmdshelf-list.1 | 2 +- doc/man/man1/cmdshelf-remote.1 | 2 +- doc/man/man1/cmdshelf-run.1 | 4 ++-- doc/man/man1/cmdshelf-update.1 | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/man/man1/cmdshelf-blob.1 b/doc/man/man1/cmdshelf-blob.1 index 941420d..a180bf1 100644 --- a/doc/man/man1/cmdshelf-blob.1 +++ b/doc/man/man1/cmdshelf-blob.1 @@ -2,7 +2,7 @@ .SH "NAME" cmdshelf-blob - Manage blobs .SH "SYNOPSIS" -\fIcmdshelf blob\fR [] +\fBcmdshelf blob\fR [] .SH "DESCRIPTION" .TP The blob subcommand manages blobs. diff --git a/doc/man/man1/cmdshelf-cat.1 b/doc/man/man1/cmdshelf-cat.1 index fa797b8..0dbaefc 100644 --- a/doc/man/man1/cmdshelf-cat.1 +++ b/doc/man/man1/cmdshelf-cat.1 @@ -2,7 +2,7 @@ .SH "NAME" cmdshelf-cat - Concatenate and print command(s). .SH "SYNOPSIS" -\fIcmdshelf cat\fR [[:]] +\fBcmdshelf cat\fR [[:]] .SH "DESCRIPTION" .TP The cat subcommand reads commands script files sequentially, writing them to the standard output. diff --git a/doc/man/man1/cmdshelf-list.1 b/doc/man/man1/cmdshelf-list.1 index 4e7a316..f6f2798 100644 --- a/doc/man/man1/cmdshelf-list.1 +++ b/doc/man/man1/cmdshelf-list.1 @@ -2,7 +2,7 @@ .SH "NAME" cmdshelf-list - Show all registered commands. .SH "SYNOPSIS" -\fIcmdshelf list\fR [\-\-path] +\fBcmdshelf list\fR [\-\-path] .SH "DESCRIPTION" .TP The list subcommand lists all commands from remotes and blobs. diff --git a/doc/man/man1/cmdshelf-remote.1 b/doc/man/man1/cmdshelf-remote.1 index c6dbfc7..e7fb341 100644 --- a/doc/man/man1/cmdshelf-remote.1 +++ b/doc/man/man1/cmdshelf-remote.1 @@ -2,7 +2,7 @@ .SH "NAME" cmdshelf-remote - Manage set of tracked repositories .SH "SYNOPSIS" -\fIcmdshelf remote\fR [] +\fBcmdshelf remote\fR [] .SH "DESCRIPTION" .TP Manage the set of repositories ("remotes"). diff --git a/doc/man/man1/cmdshelf-run.1 b/doc/man/man1/cmdshelf-run.1 index 30916f0..f59d15c 100644 --- a/doc/man/man1/cmdshelf-run.1 +++ b/doc/man/man1/cmdshelf-run.1 @@ -2,12 +2,12 @@ .SH "NAME" cmdshelf-run - Execute command .SH "SYNOPSIS" -\fIcmdshelf run\fR [:] [] +\fBcmdshelf run\fR [:] [] .SH "DESCRIPTION" .TP The run subcommand receives command-alias and whitespace separated list of parameters. .SH "AVOIDING NAMESPACE CONFLICT" .TP -The \fIrun\fR subcommand picks up first command matches the . If you have same command names from different remotes, add \fI:\fR prefix to to be explicit. +The \fBrun\fR subcommand picks up first command matches the . If you have same command names from different remotes, add <\fBremoteName\fR>: prefix to to be explicit. e.g. cmdshelf run myRemote:echo-sd hello diff --git a/doc/man/man1/cmdshelf-update.1 b/doc/man/man1/cmdshelf-update.1 index a01c462..69080eb 100644 --- a/doc/man/man1/cmdshelf-update.1 +++ b/doc/man/man1/cmdshelf-update.1 @@ -2,7 +2,7 @@ .SH "NAME" cmdshelf-update - Update cloned local repositories. .SH "SYNOPSIS" -\fIcmdshelf update\fR +\fBcmdshelf update\fR .SH "DESCRIPTION" .TP -The \fIupdate\fR subcommand updates each cloned repositories. +The \fBupdate\fR subcommand updates each cloned repositories.