Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe script arguments in documentation #675

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bloom/commands/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@ def create_subparsers(parser, generator_cmds):
add_global_arguments(cmd_parser)


def main(sysargs=None):
parser = argparse.ArgumentParser(
def get_argument_parser():
return argparse.ArgumentParser(
description="Calls a generator on a local package, e.g. bloom-generate debian"
)


def main(sysargs=None):
parser = get_argument_parser()

generator_cmds = list_generator_commands()

create_subparsers(parser, generator_cmds)
Expand Down
5 changes: 3 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))

# -- General configuration ------------------------------------------------

Expand All @@ -35,6 +35,7 @@
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinxarg.ext',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -146,7 +147,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
#html_static_path = []

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
8 changes: 8 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,11 @@ How do I release something with bloom?
---------------------------------------

Please refer to the documentation and tutorials on the bloom_ ROS wiki page.

.. toctree::
:caption: Command Details
:glob:
:hidden:
:maxdepth: 2

scripts/*
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx-argparse
6 changes: 6 additions & 0 deletions docs/scripts/bloom-export-upstream.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bloom-export-upstream
=====================

.. argparse::
:ref: bloom.commands.export_upstream.get_argument_parser
:prog: bloom-export-upstream
6 changes: 6 additions & 0 deletions docs/scripts/bloom-generate.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bloom-generate
==============

.. argparse::
:ref: bloom.commands.generate.get_argument_parser
:prog: bloom-generate
6 changes: 6 additions & 0 deletions docs/scripts/bloom-release.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bloom-release
=============

.. argparse::
:ref: bloom.commands.release.get_argument_parser
:prog: bloom-release
6 changes: 6 additions & 0 deletions docs/scripts/bloom-update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bloom-update
============

.. argparse::
:ref: bloom.commands.update.get_argument_parser
:prog: bloom-update
6 changes: 6 additions & 0 deletions docs/scripts/git-bloom-branch.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
git-bloom-branch
================

.. argparse::
:ref: bloom.commands.git.branch.get_parser
:prog: git-bloom-branch
6 changes: 6 additions & 0 deletions docs/scripts/git-bloom-config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
git-bloom-config
================

.. argparse::
:ref: bloom.commands.git.config.get_argument_parser
:prog: git-bloom-config
6 changes: 6 additions & 0 deletions docs/scripts/git-bloom-generate.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
git-bloom-generate
==================

.. argparse::
:ref: bloom.commands.git.generate.get_parser
:prog: git-bloom-generate
6 changes: 6 additions & 0 deletions docs/scripts/git-bloom-import-upstream.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
git-bloom-import-upstream
=========================

.. argparse::
:ref: bloom.commands.git.import_upstream.get_argument_parser
:prog: git-bloom-import-upstream
6 changes: 6 additions & 0 deletions docs/scripts/git-bloom-patch.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
git-bloom-patch
===============

.. argparse::
:ref: bloom.commands.git.patch.patch_main.get_argument_parser
:prog: git-bloom-patch
2 changes: 2 additions & 0 deletions docs/scripts/git-bloom-rebase.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git-bloom-rebase
================