Skip to content

Conversation

@bewest
Copy link
Member

@bewest bewest commented Mar 24, 2016

Bless all tools with -h flag.

Allows using something like this to generate docs:

$ cat mktool-ref.sh 
#!/bin/bash


OPENAPS_HOME=${1-~/Documents/openaps}
PREFIX=${2-openaps}
OUTPUT=${3-source/reference}
OUTDIR=$OUTPUT/$PREFIX
compgen -c $PREFIX | while read tool ; do
  if [[ -x $(which $tool) ]] ; then
  OUTFILE=$OUTDIR/$tool.md
  (
    mkdir -p $OUTDIR

    echo "# \`$tool\`"
    echo
    echo "## Help"
    (cd $OPENAPS_HOME
      $tool --help
    )

  ) | tee $OUTFILE
  fi
done


…-utils

Catch up to dev.
Conflicts:
	bin/oref0-determine-basal.js
	bin/oref0-pebble.js
Make the bashisms like more traditional function definitions work.
Fixes some syntax errors for things that work in bash but not sh.
@bewest
Copy link
Member Author

bewest commented Mar 30, 2016

Bringing branch up to date with dev for consideration.

This mainly tries to make sure that every single tool does something simple when -h or --help is given.

bewest added 4 commits March 30, 2016 14:19
This can now autoconfigure a basic CRUD via ns-upload and ns-get so that they
both work under the same config.  Should make setting up some NS things a bit
easier.
@bewest
Copy link
Member Author

bewest commented Apr 2, 2016

SENSITIVITIES=${4-monitor/insulin-sensitivities.json}
TARGETS=${5-monitor/bg-targets.json}
OUTPUT=${6-settings/ns-profile.json}
OUTPUT=${6-/dev/fd/1}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where to cat the results (- aka, stdout is also named /dev/fd/1) Many tools allow for an --output - or any other file, this is the bashism to do that.

@scottleibrand
Copy link
Contributor

One question (line comment) on bin/mm-format-ns-profile.sh. Otherwise 👍

@bewest bewest merged commit 1a57bb9 into dev Apr 8, 2016
@bewest bewest deleted the wip/bewest/help-output branch April 8, 2016 23:52
@bewest bewest mentioned this pull request May 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants