Skip to content
Browse files

proper manpage entries with ronn

  • Loading branch information...
1 parent 6f8cc46 commit 7960eba35064737d5167ad0eb1ff51a96b236d40 @substack committed Apr 12, 2012
Showing with 61 additions and 18 deletions.
  1. +0 −14 bin/help.js
  2. +10 −0 bin/help.sh
  3. +3 −0 bin/rootdir.js
  4. 0 help/summary → doc/commands
  5. +5 −0 doc/generate.sh
  6. +36 −0 doc/remote.markdown
  7. +7 −4 package.json
View
14 bin/help.js
@@ -1,14 +0,0 @@
-#!/usr/bin/env node
-var fs = require('fs');
-var topic = process.argv[2] || 'summary';
-var file = __dirname + '/../help/' + topic;
-
-var s = fs.createReadStream(file);
-s.pipe(process.stdout, { end : false });
-
-s.on('error', function (err) {
- if (err.code === 'ENOENT') {
- console.log('no help for topic ' + JSON.stringify(topic));
- }
- else console.error(String(err));
-});
View
10 bin/help.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+rootdir=$(fleet rootdir)
+
+if test -z "$1" || test "$1" = "commands"; then
+ cat "$rootdir/doc/commands"
+elif test -e "$rootdir/man1/$1.1"; then
+ man "$rootdir/man1/$1.1"
+else
+ echo "No manual entry for fleet $1"
+fi
View
3 bin/rootdir.js
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+var path = require('path');
+console.log(path.normalize(__dirname + '/..'));
View
0 help/summary → doc/commands
File renamed without changes.
View
5 doc/generate.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+for file in doc/*.markdown; do
+ ./node_modules/.bin/ronn --roff "$file" \
+ > man1/$(echo "$file" | sed -e 's/\.markdown$/.1/; s/^doc\///')
+done
View
36 doc/remote.markdown
@@ -0,0 +1,36 @@
+fleet-remote(1) -- manage the set of remote fleet hubs
+======================================================
+
+## SYNOPSIS
+
+ fleet remote add <name> [<options>]
+ fleet remote rm <name>
+ fleet remote ls
+
+## DESCRIPTION
+
+This command will create and update a file called `fleet.json` in your git
+project root so that you don't need to type `--hub` and `--secret` all the time.
+
+## COMMANDS
+
+### fleet remote add `<name>` [`<options>`]
+
+Add a remote named `<name>` to store the parameters from `<options>`.
+
+`<options>` can include:
+
+* hub - where the fleet hub is running as a "host:port" string
+* secret - the plaintext password to use for authentication
+
+Example usage:
+
+ fleet remote add default --hub=10.0.5.2:6002 --secret=rawr
+
+### fleet remote rm `<name>`
+
+Delete a remote named `<name>`.
+
+### fleet remote ls
+
+List all the remotes from the `fleet.json`.
View
11 package.json
@@ -9,7 +9,8 @@
"main" : "index.js",
"bin" : {
"fleet" : "bin/command.sh",
- "fleet-help" : "bin/help.js",
+ "fleet-rootdir" : "bin/rootdir.js",
+ "fleet-help" : "bin/help.sh",
"fleet-remote" : "bin/remote.js",
"fleet-deploy" : "bin/deploy.js",
"fleet-drone" : "bin/drone.js",
@@ -26,9 +27,10 @@
"staging"
],
"directories" : {
- "lib" : ".",
+ "doc" : "doc",
"example" : "example",
- "test" : "test"
+ "test" : "test",
+ "man" : "man1"
},
"scripts" : {
"test" : "tap test/*.js"
@@ -40,7 +42,8 @@
"archy" : "~0.0.2"
},
"devDependencies" : {
- "tap" : "0.0.x"
+ "tap" : "~0.2.4",
+ "ronn" : "~0.3.8"
},
"engines" : {
"node" : ">=0.4.0"

0 comments on commit 7960eba

Please sign in to comment.
Something went wrong with that request. Please try again.