arkane-systems / runingenie Goto Github PK
View Code? Open in Web Editor NEWQuickly run a wsl command from a Windows prompt.
License: MIT License
Quickly run a wsl command from a Windows prompt.
License: MIT License
As of the https://github.com/arkane-systems/RunInGenie#bugs section, it is indeed that quoting support is not very well done.
A minimal example is to run an echo command with Ansible:
PS C:\Users\steve> $ ansible all -a "/bin/echo hello"
usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD] [--become-user BECOME_USER] [-K] [-i INVENTORY]
[--list-hosts] [-l SUBSET] [-P POLL_INTERVAL] [-B SECONDS] [-o] [-t TREE] [-k] [--private-key PRIVATE_KEY_FILE]
[-u REMOTE_USER] [-c CONNECTION] [-T TIMEOUT] [--ssh-common-args SSH_COMMON_ARGS]
[--sftp-extra-args SFTP_EXTRA_ARGS] [--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args SSH_EXTRA_ARGS] [-C]
[--syntax-check] [-D] [-e EXTRA_VARS] [--vault-id VAULT_IDS]
[--ask-vault-password | --vault-password-file VAULT_PASSWORD_FILES] [-f FORKS] [-M MODULE_PATH]
[--playbook-dir BASEDIR] [--task-timeout TASK_TIMEOUT] [-a MODULE_ARGS] [-m MODULE_NAME]
pattern
ansible: error: unrecognized arguments: hello
...
To workaround this you have to wrap the entire command with double quote, then replace the echo command as single-quoted:
PS C:\Users\steve> $ "ansible all -a '/bin/echo hello'"
[DEPRECATION WARNING]: Distribution debian 10.9 on host 127.0.0.1 should use /usr/bin/python3, but is using /usr/bin/python for
backward compatibility with prior Ansible releases. A future Ansible release will default to using the discovered platform python
for this host. See https://docs.ansible.com/ansible/2.11/reference_appendices/interpreter_discovery.html for more information. This
feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
127.0.0.1 | CHANGED | rc=0 >>
hello
The UX is not pretty well-received in this sense
I want to execute a command from a bash interactive login shell, with WSL you can do this by wsl -e bash -li -c
.
It might be helpful to allow the user to change the shell used:
Lines 118 to 119 in 5e15afb
Here sh
is forced which is really bare and doesn't load any profile. If the shell can be configured to use either bash
or zsh
the usage can be different.
If for instance
PS> $
The parameter is incorrect.
is used, it would now 'expect' an argument... but what if it actually opens a shell session; this would be a replacement if wsl genie -s
.
At the moment I do $ zsh
to drop into my session:
PS> $ zsh
$
but it would be simpler if the argument need wasn't there and any shell could be used perhaps by configuration of an .config
file alongside the executable or an ini file.
Currently the default distro is assumed. The Process.Start
uses wsl
without a d
option.
For #3 I considered an override for the shell, but thinking of the GetShell
function, I think a GetDistro
option might also be useful.
eg.
{
"distro" : "fedora33",
"shell": "zsh"
}
but also with a possible -d
option. I think the configurationbuilder has a CommandLine
namespace for this too, though not familiar with this.
PS> $ -d fedora33 ps ax
...
PS> $ -d fedora33
$
Allow the use of:
--shell [shell]
/ -s [shell]
--distro [distro]
/ -d [distro]
--login
/ -l
This is a follow-up to #5 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.