order
This commit is contained in:
51
snek
51
snek
@ -1,32 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import argparse
|
||||
|
||||
def handle_clargs():
|
||||
parser = argparse.ArgumentParser(description="🐍")
|
||||
|
||||
parser.add_argument("--root", help="conda root folder / prefix (read from the current env, if not given)")
|
||||
parser.add_argument("--exe", help="conda or mamba executable (read from the current env, if not given)")
|
||||
|
||||
subparsers = parser.add_subparsers(title="commands", dest="command", required=True)
|
||||
|
||||
parser_envs = subparsers.add_parser("envs", help="print existing envs")
|
||||
parser_root = subparsers.add_parser("root", help="print root")
|
||||
parser_exe = subparsers.add_parser("exe", help="print exe")
|
||||
parser_info = subparsers.add_parser("info", help="print info")
|
||||
|
||||
parser_fork = subparsers.add_parser("fork", help="fork a conda env")
|
||||
parser_bless = subparsers.add_parser("bless", help="bless a conda env")
|
||||
|
||||
msg = "name of the conda env"
|
||||
parser_fork.add_argument("name", help=msg)
|
||||
parser_bless.add_argument("name", help=msg)
|
||||
|
||||
clargs = parser.parse_args()
|
||||
return clargs
|
||||
|
||||
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
import shutil
|
||||
@ -161,6 +135,31 @@ def maxstrlen(seq):
|
||||
|
||||
|
||||
|
||||
def handle_clargs():
|
||||
parser = argparse.ArgumentParser(description="🐍")
|
||||
|
||||
parser.add_argument("--root", help="conda root folder / prefix (read from the current env, if not given)")
|
||||
parser.add_argument("--exe", help="conda or mamba executable (read from the current env, if not given)")
|
||||
|
||||
subparsers = parser.add_subparsers(title="commands", dest="command", required=True)
|
||||
|
||||
parser_envs = subparsers.add_parser("envs", help="print existing envs")
|
||||
parser_root = subparsers.add_parser("root", help="print root")
|
||||
parser_exe = subparsers.add_parser("exe", help="print exe")
|
||||
parser_info = subparsers.add_parser("info", help="print info")
|
||||
|
||||
parser_fork = subparsers.add_parser("fork", help="fork a conda env")
|
||||
parser_bless = subparsers.add_parser("bless", help="bless a conda env")
|
||||
|
||||
msg = "name of the conda env"
|
||||
parser_fork.add_argument("name", help=msg)
|
||||
parser_bless.add_argument("name", help=msg)
|
||||
|
||||
clargs = parser.parse_args()
|
||||
return clargs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user