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

[PR196 *] Adding documentation for forthcoming changes in 0.4.0 #250

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 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
10 changes: 0 additions & 10 deletions catkin_tools/commands/catkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ def catkin_main(sysargs):
help='Forces catkin to output in color, even when the terminal does not appear to support it.')
add('--no-color', action='store_true', default=False,
help='Forces catkin to not use color in the output, regardless of the detect terminal type.')
add('--locate-extra-shell-verbs', action='store_true',
help='Returns the full path of the file to source for extra shell verbs, then exits.')

# Generate a list of verbs available
verbs = list_verbs()
Expand Down Expand Up @@ -211,14 +209,6 @@ def catkin_main(sysargs):
# Do verb alias expansion
sysargs = expand_verb_aliases(sysargs, verb_aliases)

# Check for --locate-extra-shell-verbs
for arg in sysargs:
if arg == '--locate-extra-shell-verbs':
this_dir = os.path.dirname(__file__)
shell_verbs = os.path.join(this_dir, '..', 'verbs', 'catkin_shell_verbs.bash')
print(os.path.normpath(shell_verbs))
sys.exit(0)

# Determine the verb, splitting arguments into pre and post verb
verb = None
pre_verb_args = []
Expand Down
20 changes: 20 additions & 0 deletions catkin_tools/verbs/catkin_locate/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,33 @@ def prepare_arguments(parser):
add('package', metavar='PACKAGE', nargs='?',
help="The name of a package to locate.")

special_group = parser.add_argument_group(
'Special Directories',
'Get the absolute path to a special catkin location')
add = special_group.add_argument
add('--shell-verbs', action='store_true',
help="Get the path to the shell verbs script.")
add('--examples', action='store_true',
help="Get the path to the examples directory.")

return parser


def main(opts):
# Initialize dictionary version of opts namespace
opts_vars = vars(opts) if opts else {}

# Check for special locations
root_resource_path = os.path.join(os.path.dirname(__file__), '..', '..')
if opts.shell_verbs:
shell_verbs = os.path.join(root_resource_path, 'verbs', 'catkin_shell_verbs.bash')
print(os.path.normpath(shell_verbs))
sys.exit(0)
elif opts.examples:
shell_verbs = os.path.join(root_resource_path, '..', 'docs', 'examples')
print(os.path.normpath(shell_verbs))
sys.exit(0)

# Get the workspace (either the given directory or the enclosing ws)
workspace_hint = opts_vars.get('workspace', None) or os.getcwd()
workspace = find_enclosing_workspace(workspace_hint)
Expand Down
Loading