Galaxie Shell 0.2.6 documentation


Navigation:   | Index   | Search   | Top   | Up   |
Table of Content: |

© Copyright 2020-2024, Galaxie Shell Team.

Top » Module code » glxshell.utilities.exit

Source code for glxshell.utilities.exit

import sys

from glxshell.lib.argparse import ArgumentParser

parser_exit = ArgumentParser(name="exit", description="exit shell with a given exit code")
parser_exit.add_argument(
    "code",
    nargs="*",
    type="int",
    help="exit code",
)


[docs] def glxsh_exit(*args, **kwargs): shell = kwargs.get("shell", None) code = kwargs.get("code", None) if code is None or not code: code = 0 else: code = code[0] if shell: shell.exit_code = code sys.exit(code) # shell.do_EOF() else: return code

Top » Module code » glxshell.utilities.exit

© Copyright 2020-2024, Galaxie Shell Team.
This page is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License (CC BY-NC-SA 4.0).
Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
See History and License for more information.

Last updated on None.
Created using Sphinx 8.0.2.