Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e805afc

Browse files
author
anki-code
committed
0.4.2 wip
1 parent 14cb382 commit e805afc

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ usage: xxh [ssh arguments] [user@]host[:port] [xxh arguments]
2222
2323
usage: xxh [-h] [-V] [-p SSH_PORT] [-l SSH_LOGIN] [-i SSH_PRIVATE_KEY] [-o SSH_OPTION -o ...]
2424
[user@]host[:port]
25-
[+i] [+if] [+P PASSWORD] [+PP] [+lh LOCAL_XXH_HOME] [+hh HOST_XXH_HOME]
25+
[+i] [+if] [+xc XXH_CONFIG] [+P PASSWORD] [+PP] [+lh LOCAL_XXH_HOME] [+hh HOST_XXH_HOME]
2626
[+he HOST_EXECUTE_FILE] [+s SHELL] [+v] [+vv]
2727
2828
Your favorite shell wherever you go through the ssh.

‎setup.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
python_requires='>=3.6',
1515
install_requires=[
1616
'xonsh >= 0.9.13',
17-
'pexpect >= 4.8.0'
17+
'pexpect >= 4.8.0',
18+
'pyyaml'
1819
],
1920
platforms='Unix-like',
2021
scripts=['xxh'],

‎xxh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ class Xxh:
274274
argp.add_argument('destination', metavar='[user@]host[:port]', help="Destination may be specified as [user@]host[:port] or host from ~/.ssh/config")
275275
argp.add_argument('+i','++install', default=False, action='store_true', help="Install xxh to destination host.")
276276
argp.add_argument('+if','++install-force', default=False, action='store_true', help="Removing the host xxh home and install xxh again.")
277-
argp.add_argument('+c','++config', default=self.config_file, help=f"Xxh config file in yaml. Default: " + self.config_file)
277+
argp.add_argument('+xc','++xxh-config', default=self.config_file, help=f"Xxh config file in yaml. Default: " + self.config_file)
278278
argp.add_argument('+P','++password', help="Password for ssh auth.")
279279
argp.add_argument('+PP','++password-prompt', default=False, action='store_true', help="Enter password manually using prompt.")
280280
argp.add_argument('+lh','++local-xxh-home', default=self.local_xxh_home, help=f"Local xxh home path. Default: {self.local_xxh_home}")
@@ -301,7 +301,7 @@ class Xxh:
301301
self.vverbose = opt.vverbose
302302
self.url = url = self.parse_destination(opt.destination)
303303

304-
xxh_config_file = pf"{opt.config}"
304+
xxh_config_file = pf"{opt.xxh_config}"
305305

306306
if xxh_config_file:
307307
if not xxh_config_file.exists():
@@ -313,7 +313,7 @@ class Xxh:
313313
with open(xxh_config_file) as f:
314314
xxh_config = yaml.safe_load(f)
315315

316-
if 'hosts' in xxh_config:
316+
if xxh_config and 'hosts' in xxh_config:
317317
sys_args = sys.argv[1:]
318318
conf_args = []
319319
for h, hc in xxh_config['hosts'].items():

0 commit comments

Comments
 (0)