doc/application: Use tabs for Setting Variables

Setting variables for console is platform dependent.  Having
uninterested platform mixed in is too noisy and hard to read.  Follow
"Getting Started Guide" pattern to use tabs to group things.

Getting Started Guide uses "Ubuntu" to reference Linux based platform
but Application Development uses "Linux".  This commit doesn't change
the choice of words and sticks to "Linux".

The order of the platfroms is, OTOH, unified to "Linux/macOS" from
"macOS/Linux".

This commit only changes formatting, no wording change.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
This commit is contained in:
Yasushi SHOJI 2021-10-30 14:18:10 +09:00 committed by Anas Nashif
commit b48276e995

View file

@ -269,13 +269,19 @@ Option 1: Just Once
To set the environment variable :envvar:`MY_VARIABLE` to ``foo`` for the To set the environment variable :envvar:`MY_VARIABLE` to ``foo`` for the
lifetime of your current terminal window: lifetime of your current terminal window:
.. code-block:: console .. tabs::
# Linux and macOS .. group-tab:: Linux/macOS
export MY_VARIABLE=foo
# Windows .. code-block:: console
set MY_VARIABLE=foo
export MY_VARIABLE=foo
.. group-tab:: Windows
.. code-block:: console
set MY_VARIABLE=foo
.. warning:: .. warning::
@ -288,38 +294,40 @@ lifetime of your current terminal window:
Option 2: In all Terminals Option 2: In all Terminals
========================== ==========================
**macOS and Linux**: .. tabs::
Add the ``export MY_VARIABLE=foo`` line to your shell's startup script in your .. group-tab:: Linux/macOS
home directory. For Bash, this is usually :file:`~/.bashrc` on Linux or
:file:`~/.bash_profile` on macOS. Changes in these startup scripts don't
affect shell instances already started; try opening a new terminal window to get
the new settings.
**Windows**: Add the ``export MY_VARIABLE=foo`` line to your shell's startup script in
your home directory. For Bash, this is usually :file:`~/.bashrc` on Linux
or :file:`~/.bash_profile` on macOS. Changes in these startup scripts
don't affect shell instances already started; try opening a new terminal
window to get the new settings.
You can use the ``setx`` program in ``cmd.exe`` or the third-party .. group-tab:: Windows
RapidEE program.
To use ``setx``, type this command, then close the terminal window. Any new You can use the ``setx`` program in ``cmd.exe`` or the third-party RapidEE
``cmd.exe`` windows will have :envvar:`MY_VARIABLE` set to ``foo``. program.
.. code-block:: console To use ``setx``, type this command, then close the terminal window. Any
new ``cmd.exe`` windows will have :envvar:`MY_VARIABLE` set to ``foo``.
setx MY_VARIABLE foo .. code-block:: console
To install RapidEE, a freeware graphical environment variable setx MY_VARIABLE foo
editor, `using Chocolatey`_ in an Administrator command prompt:
.. code-block:: console To install RapidEE, a freeware graphical environment variable editor,
`using Chocolatey`_ in an Administrator command prompt:
choco install rapidee .. code-block:: console
You can then run ``rapidee`` from your terminal to launch the program and set choco install rapidee
environment variables. Make sure to use the "User" environment variables area
-- otherwise, you have to run RapidEE as administrator. Also make sure to save You can then run ``rapidee`` from your terminal to launch the program and set
your changes by clicking the Save button at top left before exiting.Settings environment variables. Make sure to use the "User" environment variables area
you make in RapidEE will be available whenever you open a new terminal window. -- otherwise, you have to run RapidEE as administrator. Also make sure to save
your changes by clicking the Save button at top left before exiting.Settings
you make in RapidEE will be available whenever you open a new terminal window.
.. _env_vars_zephyrrc: .. _env_vars_zephyrrc:
@ -330,46 +338,48 @@ Choose this option if you don't want to make the variable's setting available
to all of your terminals, but still want to save the value for loading into to all of your terminals, but still want to save the value for loading into
your environment when you are using Zephyr. your environment when you are using Zephyr.
**macOS and Linux**: .. tabs::
Create a file named :file:`~/.zephyrrc` if it doesn't exist, then add this line .. group-tab:: Linux/macOS
to it:
.. code-block:: console Create a file named :file:`~/.zephyrrc` if it doesn't exist, then add this
line to it:
export MY_VARIABLE=foo .. code-block:: console
To get this value back into your current terminal environment, **you must run** export MY_VARIABLE=foo
``source zephyr-env.sh`` from the main ``zephyr`` repository. Among other
things, this script sources :file:`~/.zephyrrc`.
The value will be lost if you close the window, etc.; run ``source To get this value back into your current terminal environment, **you must
zephyr-env.sh`` again to get it back. run** ``source zephyr-env.sh`` from the main ``zephyr`` repository. Among
other things, this script sources :file:`~/.zephyrrc`.
**Windows**: The value will be lost if you close the window, etc.; run ``source
zephyr-env.sh`` again to get it back.
Add the line ``set MY_VARIABLE=foo`` to the file .. group-tab:: Windows
:file:`%userprofile%\\zephyrrc.cmd` using a text editor such as Notepad to save
the value.
To get this value back into your current terminal environment, **you must run** Add the line ``set MY_VARIABLE=foo`` to the file
``zephyr-env.cmd`` in a ``cmd.exe`` window after changing directory to the main :file:`%userprofile%\\zephyrrc.cmd` using a text editor such as Notepad to
``zephyr`` repository. Among other things, this script runs save the value.
:file:`%userprofile%\\zephyrrc.cmd`.
The value will be lost if you close the window, etc.; run ``zephyr-env.cmd`` To get this value back into your current terminal environment, **you must
again to get it back. run** ``zephyr-env.cmd`` in a ``cmd.exe`` window after changing directory
to the main ``zephyr`` repository. Among other things, this script runs
:file:`%userprofile%\\zephyrrc.cmd`.
These scripts: The value will be lost if you close the window, etc.; run
``zephyr-env.cmd`` again to get it back.
- set :envvar:`ZEPHYR_BASE` (see below) to the location of the zephyr These scripts:
repository
- adds some Zephyr-specific locations (such as zephyr's :file:`scripts`
directory) to your :envvar:`PATH` environment variable
- loads any settings from the ``zephyrrc`` files described above in
:ref:`env_vars_zephyrrc`.
You can thus use them any time you need any of these settings. - set :envvar:`ZEPHYR_BASE` (see below) to the location of the zephyr
repository
- adds some Zephyr-specific locations (such as zephyr's :file:`scripts`
directory) to your :envvar:`PATH` environment variable
- loads any settings from the ``zephyrrc`` files described above in
:ref:`env_vars_zephyrrc`.
You can thus use them any time you need any of these settings.
Option 4: Using Zephyr Build Configuration CMake package Option 4: Using Zephyr Build Configuration CMake package
========================================================= =========================================================