GithubHelp home page GithubHelp logo

runingenie's People

Contributors

cerebrate avatar gbraad avatar nugetninja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

runingenie's Issues

Fix quoting support

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

Allow to use a different shell; shorthand for `wsl genie -s` possible

It might be helpful to allow the user to change the shell used:

RunInGenie/Program.cs

Lines 118 to 119 in 5e15afb

Process ps = Process.Start (fileName: "wsl",
arguments: $"-e genie -c sh -c \"{string.Join (separator: ' ', values: param)}\"");

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.

Allow override of the distro to use

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
$ 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.