Click sub-subcommand - command-line

I want to create a python CLI script with the Click package.
I looked at the documentation, but couldn't find out how to create a command with subcommand and sub-subcommand like this:
cmd subcommand sub-subcommand <options> <args>
An idea ?
Thank you.

I found the answer. Groups can be infinitely nested.

Related

Am I able to run commands from flutter?

What I'm trying to do is run a program from my Windows/Mac flutter applications. Is there something similar to Process in java or the exec package in Go for Dart/Flutter?
The googling I have done has only led to descriptions of how to use the flutter command, and that is NOT what I am looking for.
In dart:io,
Process.run and Process.start, depending on the purpose of your program.
https://api.dart.dev/stable/2.17.3/dart-io/dart-io-library.html

micro-ROS command line explanation - ros2 - RTOS - micro-ROS Tutorials

ros2 run micro_ros_setup create_firmware_ws.sh nuttx olimex-stm32-e407
Can someone please explain me this command line!
where will I get expalantions about the command lines? Documentation?
From above command line, I want to use esp32 or stm32f4 Board instead of olimex-stm32-e407, how to do that in working way?
Explanation
I am following tutorial for micro-ROS enter link description here. I want to use STM32F4 and ESP32 Board instead.
This follows the basic ros2 run format. To break it down ros2 run is simply used to run(not launch) an executable under the ros2 environment. It also takes the format of ros2 run <package> <executable>, so this means micro_ros_setup is the ros2 package it's searching and create_firmware_ws.sh is the executable. The next two arguments, nuttx olimex-stm32-e407, are just passed onto the bash script to be used internally. I'm not familiar with who released this ros2 package, however, using a shell script with ros2 run is not something that should be done and is bad design.

Eclipse IDE: How to add this configuration during running?

For running of one of my C++ programs, using terminal(Ubuntu) I use
Note: I'm trying to Embed Python in C++. Hence, PYTHONPATH in C++.
Refer to Python/C API for more details.
$ PYTHONPATH=. ./prog_name
Sorry, I didn't know how to ask this question on Google. I want to do the same running with Eclipse. I don't know where to specify PYTHONPATH=. during running from Eclipse. How to produce the equivalent of this? I tried putting in argument list, but obviously it didn't work. Thanks!
PS. Don't downvote just because you don't understand that python scripts can be called through C++ .. Lol
Hi to all those facing the same problem, i found the solution!
setenv() is a function defined in which sets the environment variable. Just have to run it!
setenv("PYTHONPATH",".",1);
for more info on setenv:
$ man setenv
All the best :)

yaws not building on CentOS after erlang build OK

Problem:
yaws configure is failing after autoconf with unable to find erl
Question:
Why this error is showing, because erl can be found from a bash shell from anywhere
which erl --> /usr/local/bin/erl
Thanks.
You might consider running the configure script via sh -x configure to see the detailed output showing exactly what the configure script is doing. Be warned that there'll potentially be a lot of output to sift through. Feel free to email the Yaws mailing list if you need help deciphering it.

How to make sphinx look for modules in virtualenv while building html?

I want to build html docs using a virtualenv instead of the native environment on my machine.
I've entered the virtualenv but when I run make html I get errors saying the module can't be imported - I know the errors are due to the module being unavailable in my native environment.
How can I specify which environment should be used when searching for docs (eg the virtualenv)?
The problem is correctly spotted by Mathijs.
$ which sphinx-build
/usr/local/bin/sphinx-build
I solved this issue installing sphinx itself in the virtual environment.
With the environment activated:
$ source /home/migonzalvar/envs/myenvironment/bin/activate
$ pip install sphinx
$ which sphinx-build
/home/migonzalvar/envs/myenvironment/bin/sphinx-build
It seems neat enough.
The problem here is that make html uses the sphinx-build command as a normal shell command, which explicitly specifies which Python interpreter to use in the first line of the file (ie. #!/usr/bin/python). If Python gets invoked in this way, it will not use your virtual environment.
A quick and dirty way around this is by explicitly calling the sphinx-build Python script from an interpreter. In the Makefile, this can be achieved by changing SPHINXBUILD to the following:
SPHINXBUILD = python <absolute_path_to_sphinx-build-file>/sphinx-build
If you do not want to modify your Makefile you can also pass this parameter from the command line, as follows:
make html SPHINXBUILD='python <path_to_sphinx>/sphinx-build'
Now if you execute make build from within your VirtualEnv environment, it should use the Python interpreter from within your environment and you should see Sphinx finding all the goodies it requires.
I am well aware that this is not a neat solution, as a Makefile like this should not assume any specific location for the sphinx-build file, so any suggestions for a more suitable solution are warmly welcomed.
I had the same problem, but I couldn't use the accepted solution because I didn't use the Makefile. I was calling sphinx-build from within a custom python build file. What I really wanted to do was to call sphinx-build with the exact same environment that I was calling my python build script with. Fiddling with paths was too complicated and error prone, so I ended up with what seems to me like an elegant solution, which is to "manually" load the console script entry point and call it:
from pkg_resources import load_entry_point
cmd = load_entry_point('Sphinx', 'console_scripts', 'sphinx-build')
cmd(['sphinx-build', basepath, destpath])