mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-21 14:37:47 +00:00
Remove man pages
This commit is contained in:
parent
f220e380a7
commit
4211333e4e
@ -3,7 +3,6 @@ path = require('path')
|
||||
gulp = require('gulp')
|
||||
mocha = require('gulp-mocha')
|
||||
coffee = require('gulp-coffee')
|
||||
markedMan = require('gulp-marked-man')
|
||||
coffeelint = require('gulp-coffeelint')
|
||||
shell = require('gulp-shell')
|
||||
packageJSON = require('./package.json')
|
||||
@ -16,16 +15,9 @@ OPTIONS =
|
||||
app: [ 'lib/**/*.coffee', '!lib/**/*.spec.coffee' ]
|
||||
tests: 'tests/**/*.spec.coffee'
|
||||
json: [ 'lib/**/*.json' ]
|
||||
man: 'man/**/*.md'
|
||||
directories:
|
||||
man: 'man/'
|
||||
build: 'build/'
|
||||
|
||||
gulp.task 'man', ->
|
||||
gulp.src(OPTIONS.files.man)
|
||||
.pipe(markedMan())
|
||||
.pipe(gulp.dest(OPTIONS.directories.man))
|
||||
|
||||
gulp.task 'test', ->
|
||||
gulp.src(OPTIONS.files.tests, read: false)
|
||||
.pipe(mocha({
|
||||
@ -50,9 +42,7 @@ gulp.task 'lint', ->
|
||||
|
||||
gulp.task 'build', [
|
||||
'coffee'
|
||||
'man'
|
||||
]
|
||||
|
||||
gulp.task 'watch', [ 'test', 'lint', 'coffee' ], ->
|
||||
gulp.watch([ OPTIONS.files.coffee, OPTIONS.files.json ], [ 'coffee' ])
|
||||
gulp.watch([ OPTIONS.files.man ], [ 'man' ])
|
||||
|
@ -1,48 +0,0 @@
|
||||
.TH "RESIN" "1" "July 2015" "" ""
|
||||
.SH "NAME"
|
||||
\fBresin\fR \- tab completion for resin
|
||||
.SH DESCRIPTION
|
||||
.P
|
||||
It provides basic completion capabilities for \fBzsh\fP and \fBbash\fP\|\.
|
||||
.P
|
||||
If you're using \fBbash\fP, add the following line to your \fB~/\.bashrc\fP:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
\|\. /path/to/resin/completion/resin\.sh\.
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
or create a symlink like this if you have automatic bash completion set up:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
ln \- /path/to/resin/completion/resin\.sh /etc/bash\-completion\.d/resin
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
or, perhaps:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
ln \- /path/to/resin/completion/resin\.sh /usr/local/etc/bash\-completion\.d/resin
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
If you're using \fBzsh\fP, add the following to your \fB~/\.zshrc\fP:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
autoload bashcompinit
|
||||
bashcompinit
|
||||
source /path/to/resin/completion/resin\.sh
|
||||
.fi
|
||||
.RE
|
||||
.SH RESIN PATH
|
||||
.P
|
||||
\fB/path/to/resin\fP refers to the place where resin was globally installed in your system\.
|
||||
.P
|
||||
This is usually something like \fB/usr/lib/node_modules/resin\fP, or \fBC:\\Users\\AppData\\Roaming\\npm\\node_modules\\resin\fP on Windows\.
|
||||
.SH COPYRIGHT
|
||||
.P
|
||||
resin is Copyright (C) 2014 Resin\.io https://resin\.io
|
@ -1,34 +0,0 @@
|
||||
resin(1) - tab completion for resin
|
||||
===================================
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
It provides basic completion capabilities for `zsh` and `bash`.
|
||||
|
||||
If you're using `bash`, add the following line to your `~/.bashrc`:
|
||||
|
||||
. /path/to/resin/completion/resin.sh.
|
||||
|
||||
or create a symlink like this if you have automatic bash completion set up:
|
||||
|
||||
ln - /path/to/resin/completion/resin.sh /etc/bash-completion.d/resin
|
||||
|
||||
or, perhaps:
|
||||
|
||||
ln - /path/to/resin/completion/resin.sh /usr/local/etc/bash-completion.d/resin
|
||||
|
||||
If you're using `zsh`, add the following to your `~/.zshrc`:
|
||||
|
||||
autoload bashcompinit
|
||||
bashcompinit
|
||||
source /path/to/resin/completion/resin.sh
|
||||
|
||||
## RESIN PATH
|
||||
|
||||
`/path/to/resin` refers to the place where resin was globally installed in your system.
|
||||
|
||||
This is usually something like `/usr/lib/node_modules/resin`, or `C:\Users\AppData\Roaming\npm\node_modules\resin` on Windows.
|
||||
|
||||
## COPYRIGHT
|
||||
|
||||
resin is Copyright (C) 2014 Resin.io <https://resin.io>
|
@ -1,196 +0,0 @@
|
||||
.TH "RESIN\-PLUGINS" "1" "July 2015" "" ""
|
||||
.SH "NAME"
|
||||
\fBresin-plugins\fR \- Creating Resin CLI plugins
|
||||
.SH DESCRIPTION
|
||||
.P
|
||||
Resin CLI plugins are managed by NPM\. Installing an NPM module that starts with \fBresin\-plugin\-*\fP globally will automatically make it available to the Resin CLI\.
|
||||
.SH TUTORIAL
|
||||
.P
|
||||
In this guide, we'll create a simple hello plugin that greets the user\.
|
||||
.P
|
||||
Create a directory called \fBresin\-plugin\-hello\fP, containing a single \fBindex\.js\fP file\.
|
||||
.P
|
||||
Within the new project, run \fBnpm init\fP and make sure the package name is set to \fBresin\-plugin\-hello\fP as well\.
|
||||
.P
|
||||
Also make sure that you have a \fBmain\fP field in \fBpackage\.json\fP that points to the \fBindex\.js\fP file you created above\.
|
||||
.P
|
||||
Your \fBpackage\.json\fP should look something like this:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
{
|
||||
"name": "resin\-plugin\-hello",
|
||||
"version": "1\.0\.0",
|
||||
"main": "index\.js",
|
||||
"description": "My first Resin plugin",
|
||||
"license": "MIT"
|
||||
}
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
Your index file should export an object (if exposing a single command) or an array of objects (if exposing multiple commands)\.
|
||||
.P
|
||||
Notice that is very important that your \fBpackage\.json\fP \fBmain\fP field points to the file that is exporting the commands for the plugin to work correctly\.
|
||||
.P
|
||||
Each object describes a single command\. The accepted fields are:
|
||||
.RS 0
|
||||
.IP \(bu 2
|
||||
\fBsignature\fP: A Capitano \fIhttps://github\.com/resin\-io/capitano\fR signature\.
|
||||
.IP \(bu 2
|
||||
\fBdescription\fP: A string containing a short description of the command\. This will be shown on the Resin general help\.
|
||||
.IP \(bu 2
|
||||
\fBhelp\fP: A string containing an usage help page\. This will be shown when passing the signature to the \fBhelp\fP command\.
|
||||
.IP \(bu 2
|
||||
\fBaction\fP: A function that defines the action to take when the command is matched\. The function will be given 3 arguments (\fBparams\fP, \fBoptions\fP, \fBdone\fP)\.
|
||||
.IP \(bu 2
|
||||
\fBpermission\fP: A string describing the required permissions to run the command\.
|
||||
.IP \(bu 2
|
||||
\fBoptions\fP: An array of Capitano \fIhttps://github\.com/resin\-io/capitano\fR options\.
|
||||
|
||||
.RE
|
||||
.P
|
||||
The \fBindex\.js\fP file should look something like:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
module\.exports = [
|
||||
{
|
||||
signature: 'hello <name>',
|
||||
description: 'example plugin',
|
||||
help: 'This is an example plugin\.',
|
||||
action: function(params, options, done) {
|
||||
console\.log('Hey there ' + params\.name + '!');
|
||||
done();
|
||||
}
|
||||
}
|
||||
]
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
As we're only exporting a single command, we can export the object directly:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
module\.exports = {
|
||||
signature: 'hello <name>',
|
||||
description: 'example plugin',
|
||||
help: 'This is an example plugin',
|
||||
action: function(params, options, done) {
|
||||
console\.log('Hey there ' + params\.name + '!');
|
||||
done();
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
This example will register a \fBhello\fP command which requires a \fBname\fP parameter, and greets the user in result\.
|
||||
.P
|
||||
To test the plugin, first create a global link by running the following command inside your plugin directory:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ npm link
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
Now if you run \fB$ resin help\fP you should see your new command at the bottom of the list\.
|
||||
.P
|
||||
Try it out:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ resin hello Juan
|
||||
Hey there Juan!
|
||||
.fi
|
||||
.RE
|
||||
.SH DONE CALLBACK
|
||||
.P
|
||||
It's very important that you call the \fBdone()\fP callback after your action finishes\. If you pass an \fBError\fP instance to \fBdone()\fP, its message will be displayed by the Resin CLI, exiting with an error code 1\.
|
||||
.P
|
||||
If your action is synchronous and doesn't return any error, you can omit the \fBdone()\fP callback all together\. For example:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
module\.exports = {
|
||||
signature: 'hello <name>',
|
||||
description: 'example plugin',
|
||||
help: 'This is an example plugin',
|
||||
action: function(params, options) {
|
||||
console\.log('Hey there ' + params\.name + '!');
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.RE
|
||||
.SH PERMISSIONS
|
||||
.P
|
||||
You can set a command permission to restrict access to the commands\. Currently, the only registered permission is \fBuser\fP, which requires the user to log in to Resin from the CLI\.
|
||||
.P
|
||||
To require the user to login before calling our hello plugin, we can add \fBpermission: 'user'\fP to the command description:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
module\.exports = {
|
||||
signature: 'hello <name>',
|
||||
description: 'example plugin',
|
||||
help: 'This is an example plugin',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
console\.log('Hey there ' + params\.name + '!');
|
||||
done();
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
Now if the user attempts to call our command without being logged in, a nice error message asking him to login will be shown instead\.
|
||||
.SH OPTIONS
|
||||
.P
|
||||
You can define certain options that your command accepts\. Notice these are per command, and thus are not available to other command that doesn't declares them as well\.
|
||||
.P
|
||||
Let's say we want to allow the user to configure the greeting language\. For example:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
$ resin hello Juan \-\-language spanish
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
We first need to register the \fBlanguage option\fP:
|
||||
.P
|
||||
.RS 2
|
||||
.nf
|
||||
module\.exports = {
|
||||
signature: 'hello <name>',
|
||||
description: 'example plugin',
|
||||
help: 'This is an example plugin',
|
||||
options: [
|
||||
{
|
||||
signature: 'language',
|
||||
parameter: 'language',
|
||||
description: 'the greeting language',
|
||||
alias: 'l'
|
||||
}
|
||||
],
|
||||
action: function(params, options, done) {
|
||||
if(options\.language === 'spanish') {
|
||||
console\.log('Hola ' + params\.name + '!');
|
||||
} else {
|
||||
console\.log('Hey there ' + params\.name + '!');
|
||||
}
|
||||
|
||||
done();
|
||||
}
|
||||
}
|
||||
.fi
|
||||
.RE
|
||||
.P
|
||||
Here, we declared an option with a signature of \fBlanguage\fP (so we can use it as \fB\-\-language\fP), a parameter name of \fBlanguage\fP as well (this means we'll be able to access the option as the \fBlanguage\fP key: \fBoptions\.language\fP), a nice description and an alias \fBl\fP (which means we can use \fB\-l <language>\fP too)\.
|
||||
.SH COFFEESCRIPT
|
||||
.P
|
||||
We have CoffeeScript support out of the box\. Implement your commands in \fBindex\.coffee\fP and point \fBpackage\.json\fP \fBmain\fP to that file\.
|
||||
.SH RESIN\-SDK
|
||||
.P
|
||||
You can use the Resin SDK NodeJS module within your own plugins to communicate with Resin\.
|
||||
.SH RESIN\-CLI\-VISUALS
|
||||
.P
|
||||
Use the Resin CLI Visuals module to make use of the widgets used by the built\-in CLI commands\.
|
@ -1,159 +0,0 @@
|
||||
resin-plugins(1) - Creating Resin CLI plugins
|
||||
=============================================
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Resin CLI plugins are managed by NPM. Installing an NPM module that starts with `resin-plugin-*` globally will automatically make it available to the Resin CLI.
|
||||
|
||||
## TUTORIAL
|
||||
|
||||
In this guide, we'll create a simple hello plugin that greets the user.
|
||||
|
||||
Create a directory called `resin-plugin-hello`, containing a single `index.js` file.
|
||||
|
||||
Within the new project, run `npm init` and make sure the package name is set to `resin-plugin-hello` as well.
|
||||
|
||||
Also make sure that you have a `main` field in `package.json` that points to the `index.js` file you created above.
|
||||
|
||||
Your `package.json` should look something like this:
|
||||
|
||||
{
|
||||
"name": "resin-plugin-hello",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"description": "My first Resin plugin",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
||||
Your index file should export an object (if exposing a single command) or an array of objects (if exposing multiple commands).
|
||||
|
||||
Notice that is very important that your `package.json` `main` field points to the file that is exporting the commands for the plugin to work correctly.
|
||||
|
||||
Each object describes a single command. The accepted fields are:
|
||||
|
||||
- `signature`: A [Capitano](https://github.com/resin-io/capitano) signature.
|
||||
- `description`: A string containing a short description of the command. This will be shown on the Resin general help.
|
||||
- `help`: A string containing an usage help page. This will be shown when passing the signature to the `help` command.
|
||||
- `action`: A function that defines the action to take when the command is matched. The function will be given 3 arguments (`params`, `options`, `done`).
|
||||
- `permission`: A string describing the required permissions to run the command.
|
||||
- `options`: An array of [Capitano](https://github.com/resin-io/capitano) options.
|
||||
|
||||
The `index.js` file should look something like:
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
signature: 'hello <name>',
|
||||
description: 'example plugin',
|
||||
help: 'This is an example plugin.',
|
||||
action: function(params, options, done) {
|
||||
console.log('Hey there ' + params.name + '!');
|
||||
done();
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
As we're only exporting a single command, we can export the object directly:
|
||||
|
||||
module.exports = {
|
||||
signature: 'hello <name>',
|
||||
description: 'example plugin',
|
||||
help: 'This is an example plugin',
|
||||
action: function(params, options, done) {
|
||||
console.log('Hey there ' + params.name + '!');
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
||||
This example will register a `hello` command which requires a `name` parameter, and greets the user in result.
|
||||
|
||||
To test the plugin, first create a global link by running the following command inside your plugin directory:
|
||||
|
||||
$ npm link
|
||||
|
||||
Now if you run `$ resin help` you should see your new command at the bottom of the list.
|
||||
|
||||
Try it out:
|
||||
|
||||
$ resin hello Juan
|
||||
Hey there Juan!
|
||||
|
||||
## DONE CALLBACK
|
||||
|
||||
It's very important that you call the `done()` callback after your action finishes. If you pass an `Error` instance to `done()`, its message will be displayed by the Resin CLI, exiting with an error code 1.
|
||||
|
||||
If your action is synchronous and doesn't return any error, you can omit the `done()` callback all together. For example:
|
||||
|
||||
module.exports = {
|
||||
signature: 'hello <name>',
|
||||
description: 'example plugin',
|
||||
help: 'This is an example plugin',
|
||||
action: function(params, options) {
|
||||
console.log('Hey there ' + params.name + '!');
|
||||
}
|
||||
}
|
||||
|
||||
## PERMISSIONS
|
||||
|
||||
You can set a command permission to restrict access to the commands. Currently, the only registered permission is `user`, which requires the user to log in to Resin from the CLI.
|
||||
|
||||
To require the user to login before calling our hello plugin, we can add `permission: 'user'` to the command description:
|
||||
|
||||
module.exports = {
|
||||
signature: 'hello <name>',
|
||||
description: 'example plugin',
|
||||
help: 'This is an example plugin',
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
console.log('Hey there ' + params.name + '!');
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
||||
Now if the user attempts to call our command without being logged in, a nice error message asking him to login will be shown instead.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
You can define certain options that your command accepts. Notice these are per command, and thus are not available to other command that doesn't declares them as well.
|
||||
|
||||
Let's say we want to allow the user to configure the greeting language. For example:
|
||||
|
||||
$ resin hello Juan --language spanish
|
||||
|
||||
We first need to register the `language option`:
|
||||
|
||||
module.exports = {
|
||||
signature: 'hello <name>',
|
||||
description: 'example plugin',
|
||||
help: 'This is an example plugin',
|
||||
options: [
|
||||
{
|
||||
signature: 'language',
|
||||
parameter: 'language',
|
||||
description: 'the greeting language',
|
||||
alias: 'l'
|
||||
}
|
||||
],
|
||||
action: function(params, options, done) {
|
||||
if(options.language === 'spanish') {
|
||||
console.log('Hola ' + params.name + '!');
|
||||
} else {
|
||||
console.log('Hey there ' + params.name + '!');
|
||||
}
|
||||
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
||||
Here, we declared an option with a signature of `language` (so we can use it as `--language`), a parameter name of `language` as well (this means we'll be able to access the option as the `language` key: `options.language`), a nice description and an alias `l` (which means we can use `-l <language>` too).
|
||||
|
||||
## COFFEESCRIPT
|
||||
|
||||
We have CoffeeScript support out of the box. Implement your commands in `index.coffee` and point `package.json` `main` to that file.
|
||||
|
||||
## RESIN-SDK
|
||||
|
||||
You can use the Resin SDK NodeJS module within your own plugins to communicate with Resin.
|
||||
|
||||
## RESIN-CLI-VISUALS
|
||||
|
||||
Use the Resin CLI Visuals module to make use of the widgets used by the built-in CLI commands.
|
12
man/resin.1
12
man/resin.1
@ -1,12 +0,0 @@
|
||||
.TH "RESIN" "1" "July 2015" "" ""
|
||||
.SH "NAME"
|
||||
\fBresin\fR \- command line tool to interact with resin\.io
|
||||
.SH SYNOPSIS
|
||||
.P
|
||||
\fBresin\fP [options] <command>
|
||||
.SH DESCRIPTION
|
||||
.P
|
||||
\fBresin\fR is a powerful command line application to interact, develop and deploy resin\.io applications and devices\.
|
||||
.SH COPYRIGHT
|
||||
.P
|
||||
resin is Copyright (C) 2014 Resin\.io https://resin\.io
|
@ -1,14 +0,0 @@
|
||||
resin(1) - command line tool to interact with resin.io
|
||||
======================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
`resin` [options] <command>
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
**resin** is a powerful command line application to interact, develop and deploy resin.io applications and devices.
|
||||
|
||||
## COPYRIGHT
|
||||
|
||||
resin is Copyright (C) 2014 Resin.io <https://resin.io>
|
@ -9,11 +9,6 @@
|
||||
"url": "git@github.com:resin-io/resin-cli.git"
|
||||
},
|
||||
"preferGlobal": true,
|
||||
"man": [
|
||||
"./man/resin.1",
|
||||
"./man/resin-completion.1",
|
||||
"./man/resin-plugins.1"
|
||||
],
|
||||
"bin": {
|
||||
"resin": "./bin/resin"
|
||||
},
|
||||
@ -37,7 +32,6 @@
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-coffee": "^2.2.0",
|
||||
"gulp-coffeelint": "^0.5.0",
|
||||
"gulp-marked-man": "~0.3.1",
|
||||
"gulp-mocha": "^2.1.3",
|
||||
"gulp-shell": "^0.4.2",
|
||||
"gulp-util": "^3.0.6",
|
||||
|
Loading…
Reference in New Issue
Block a user