From 26e3dac192a15f1e180d7991bfa84d3d126a900f Mon Sep 17 00:00:00 2001 From: Bruno Tavares Date: Fri, 21 Feb 2014 18:04:19 -0300 Subject: [PATCH] Documentation for kickstart namespace commands --- docs/kickstart/codename.md | 10 ++++++++++ docs/kickstart/command_exists.md | 8 ++++++++ docs/kickstart/context.md | 14 ++++++++++++++ docs/kickstart/mute.md | 11 +++++++++++ docs/kickstart/os.md | 11 +++++++++++ docs/kickstart/os/is.md | 12 ++++++++++++ 6 files changed, 66 insertions(+) create mode 100644 docs/kickstart/codename.md create mode 100644 docs/kickstart/command_exists.md create mode 100644 docs/kickstart/context.md create mode 100644 docs/kickstart/mute.md create mode 100644 docs/kickstart/os.md create mode 100644 docs/kickstart/os/is.md diff --git a/docs/kickstart/codename.md b/docs/kickstart/codename.md new file mode 100644 index 0000000..e5e2010 --- /dev/null +++ b/docs/kickstart/codename.md @@ -0,0 +1,10 @@ +# kickstart.codename +Prints the codename for the distro. For Ubuntu so far. + + +### Example + +```bash +$ kickstart.codename +precise +``` diff --git a/docs/kickstart/command_exists.md b/docs/kickstart/command_exists.md new file mode 100644 index 0000000..aac31c2 --- /dev/null +++ b/docs/kickstart/command_exists.md @@ -0,0 +1,8 @@ +# kickstart.command_exists command_name +Return 0 if commands is present on the current path, or 1 when it is not + +### Example + +```bash +$ kickstart.command_exists node || echo "Node not found" +``` diff --git a/docs/kickstart/context.md b/docs/kickstart/context.md new file mode 100644 index 0000000..fe54ab3 --- /dev/null +++ b/docs/kickstart/context.md @@ -0,0 +1,14 @@ +# kickstart.context current_context +Store the current context so kickstart.mute and kickstart.info can append the information + +### Example + +```bash +$ kickstart.info Some information +Some information + +$ kickstart.context Ubuntu +Setting up Ubuntu +$ kickstart.info Some information +Ubuntu >> Some information +``` diff --git a/docs/kickstart/mute.md b/docs/kickstart/mute.md new file mode 100644 index 0000000..7f5d72d --- /dev/null +++ b/docs/kickstart/mute.md @@ -0,0 +1,11 @@ +# kickstart.mute command to run +Run the command with stdout and stder outputing to /dev/null. +Inform it is about to run. +Returns the command result + +### Example + +```bash +$ kickstart.mute id root +Runnig "id root" +``` diff --git a/docs/kickstart/os.md b/docs/kickstart/os.md new file mode 100644 index 0000000..f453dd2 --- /dev/null +++ b/docs/kickstart/os.md @@ -0,0 +1,11 @@ +# kickstart.os +Print the current operational system name + + +### Example +``` +$ kickstart.os +Ubuntu +$ kickstart.os +Mac +``` diff --git a/docs/kickstart/os/is.md b/docs/kickstart/os/is.md new file mode 100644 index 0000000..f360cb7 --- /dev/null +++ b/docs/kickstart/os/is.md @@ -0,0 +1,12 @@ +# kickstart.os.is os_name +Returns 0 if we are on the expected OS and 1 if not. + +### Example + +```bash +$ kickstart.os.is Ubuntu && echo We are on Ubuntu +$ ! kickstart.os.is Mac && echo We are not on Mac +$ if [ kickstart.os.is Ubuntu ]; then + echo Getting into Ubuntu system + fi +```