Skip to content

Commit

Permalink
Update usage style. See #145, #148, #73
Browse files Browse the repository at this point in the history
  • Loading branch information
nsheff committed Jul 13, 2017
1 parent a8f388e commit 17fb841
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 32 deletions.
61 changes: 41 additions & 20 deletions doc/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ Each task is controlled by one of the five main commands ``run``, ``summarize``,
- ``looper destroy``: Deletes all output results for this project.


Command-line usage:
******************************

Here you can see the command-line usage instructions for the main looper command and for each subcommand:


.. code-block:: shell
``looper --help``
----------------------------------

>looper --help
.. code-block:: shell
version: 0.6.0-dev
usage: looper [-h] [-V] {run,summarize,destroy,check,clean} ...
Expand All @@ -43,9 +46,12 @@ Here you can see the command-line usage instructions for the main looper command
For subcommand-specific options, type: 'looper <subcommand> -h'
https://github.com/epigen/looper For debug options, type: 'looper -h
--details'
>looper run --help
``looper run --help``
----------------------------------
.. code-block:: shell
version: 0.6.0-dev
usage: looper run [-h] [-t TIME_DELAY] [--ignore-flags] [--compute COMPUTE]
[--env ENV] [--limit LIMIT] [--file-checks] [-d]
Expand All @@ -71,9 +77,12 @@ Here you can see the command-line usage instructions for the main looper command
-d, --dry-run Don't actually submit the project/subproject.
--sp SUBPROJECT Name of subproject to use, as designated in the
project's configuration file
>looper summarize --help
``looper summarize --help``
----------------------------------
.. code-block:: shell
version: 0.6.0-dev
usage: looper summarize [-h] [--file-checks] [-d] [--sp SUBPROJECT]
config_file
Expand All @@ -87,9 +96,12 @@ Here you can see the command-line usage instructions for the main looper command
-d, --dry-run Don't actually submit the project/subproject.
--sp SUBPROJECT Name of subproject to use, as designated in the project's
configuration file
>looper destroy --help
``looper destroy --help``
----------------------------------
.. code-block:: shell
version: 0.6.0-dev
usage: looper destroy [-h] [--file-checks] [-d] [--sp SUBPROJECT] config_file
Expand All @@ -102,9 +114,12 @@ Here you can see the command-line usage instructions for the main looper command
-d, --dry-run Don't actually submit the project/subproject.
--sp SUBPROJECT Name of subproject to use, as designated in the project's
configuration file
>looper check --help
``looper check --help``
----------------------------------
.. code-block:: shell
version: 0.6.0-dev
usage: looper check [-h] [--file-checks] [-d] [--sp SUBPROJECT] config_file
Expand All @@ -117,9 +132,12 @@ Here you can see the command-line usage instructions for the main looper command
-d, --dry-run Don't actually submit the project/subproject.
--sp SUBPROJECT Name of subproject to use, as designated in the project's
configuration file
>looper clean --help
``looper clean --help``
----------------------------------
.. code-block:: shell
version: 0.6.0-dev
usage: looper clean [-h] [--file-checks] [-d] [--sp SUBPROJECT] config_file
Expand All @@ -132,9 +150,12 @@ Here you can see the command-line usage instructions for the main looper command
-d, --dry-run Don't actually submit the project/subproject.
--sp SUBPROJECT Name of subproject to use, as designated in the project's
configuration file
>looper --details --help
``looper --help --details``
----------------------------------
.. code-block:: shell
version: 0.6.0-dev
usage: looper [-h] [-V] [--logfile LOGFILE] [--verbosity {0,1,2,3,4}]
[--logging-level LOGGING_LEVEL] [--dbg]
Expand Down
6 changes: 2 additions & 4 deletions doc/source/usage.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ Each task is controlled by one of the five main commands ``run``, ``summarize``,
- ``looper destroy``: Deletes all output results for this project.


Command-line usage:
******************************

Here you can see the command-line usage instructions for the main looper command and for each subcommand:


.. code-block:: shell

>looper --help
22 changes: 14 additions & 8 deletions update-usage-docs.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
looper --help > USAGE.temp 2>&1
cp doc/source/usage.template usage.template
#looper --help > USAGE.temp 2>&1

for cmd in run summarize destroy check clean "--details"; do
for cmd in "--help" "run --help" "summarize --help" "destroy --help" "check --help" "clean --help" "--help --details"; do
echo $cmd
echo -e "\n\n>looper $cmd --help" >> USAGE.temp
looper $cmd --help >> USAGE.temp 2>&1
echo -e "\n\`\`looper $cmd\`\`" > USAGE_header.temp
echo -e "----------------------------------" >> USAGE_header.temp
looper $cmd --help > USAGE.temp 2>&1
sed -i 's/^/\t/' USAGE.temp
sed -i '1s/^/\n.. code-block:: shell\n\n/' USAGE.temp
#sed -i -e "/\`looper $cmd\`/r USAGE.temp" -e '$G' usage.template # for -in place inserts
cat USAGE_header.temp USAGE.temp >> usage.template # to append to the end
done

sed -i 's/^/\t/' USAGE.temp
sed -e '/>looper --help/r USAGE.temp' -e '$G' doc/source/usage.template > doc/source/usage.rst
cat doc/source/usage.rst
rm USAGE.temp
rm USAGE_header.temp
mv usage.template doc/source/usage.rst
cat doc/source/usage.rst
#rm USAGE.temp

0 comments on commit 17fb841

Please sign in to comment.