From: "Andrew Fish" <afish@apple.com>
To: "Carsey, Jaben" <jaben.carsey@intel.com>
Cc: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"jim.dailey@dell.com" <jim.dailey@dell.com>,
"tim.lewis@insyde.com" <tim.lewis@insyde.com>
Subject: Re: [edk2-devel] Shell feature?
Date: Tue, 11 Feb 2020 18:08:27 -0800 [thread overview]
Message-ID: <1FCC7027-A508-4891-8400-3CDD3B371E34@apple.com> (raw)
In-Reply-To: <BY5PR11MB4007AE3E98707E2148DD74099C1B0@BY5PR11MB4007.namprd11.prod.outlook.com>
Jaben,
My example was confusing, but my use case was to put this code in a library that adds a command. So after I register the command I’d like to register the file type to be processed by it.
Making an alias for an external command could be a different feature?
> On Feb 11, 2020, at 5:30 PM, Carsey, Jaben <jaben.carsey@intel.com> wrote:
>
> Andrew
>
> You can already add a command via a driver (including a driver's library). Check into the Dynamic Commands in the shell spec.
>
> Associating a file type with a command, basically if the first thing on the command line is a file of that type, then prepend the command and re-process the line, is very doable. It's almost like the alias feature that already exists.
>
> I do agree with Tim that we should do a spec update, but concurrent development of code and spec seems required to prevent re-doing the spec.
>
> -Jaben
>
>> -----Original Message-----
>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Jim
>> Dailey
>> Sent: Tuesday, February 11, 2020 1:31 PM
>> To: devel@edk2.groups.io
>> Cc: tim.lewis@insyde.com; afish@apple.com
>> Subject: Re: [edk2-devel] Shell feature?
>>
>> Andrew,
>>
>> Granted such a feature would be nice, but it seems like it might be a fair
>> amount of trouble just to avoid typing "python3", which could be aliased to
>> something as short a "p".
>>
>> Jim
>>
>> -----Original Message-----
>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Tim
>> Lewis
>> Sent: Tuesday, February 11, 2020 2:28 PM
>> To: devel@edk2.groups.io; afish@apple.com
>> Subject: Re: [edk2-devel] Shell feature?
>>
>>
>> [EXTERNAL EMAIL]
>>
>> Andrew --
>>
>> I think this is a good idea, but I think this is probably a shell spec issue
>> because I don't want competing, incompatible implementations.
>>
>> A few other issues: I think there is a persistence issue (similar to shell
>> variables) so that the change could be installed and survive a reboot. I also
>> think there can be a simple shell command that manages extensions (so that
>> they can be installed by a script)
>>
>> Tim
>>
>> -----Original Message-----
>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Andrew
>> Fish via Groups.Io
>> Sent: Monday, February 10, 2020 12:12 PM
>> To: devel@edk2.groups.io
>> Subject: [edk2-devel] Shell feature?
>>
>> I wanted to start a conversation on the mailing list prior to writing up a BZ, to
>> make sure I'm not missing anything, or in case there is a better way to
>> implement this.
>>
>> I was thinking it would be good to have a Shell API that lets you associate a
>> file type with an internal or external shell command. The Idea would be to
>> pre-pend the internal/external shell command to the file name and also pass
>> the arguments.
>>
>> So this:
>> fs0:>dump.py 1 2 3
>>
>> Becomes:
>> fs0:>python3.efi dump.py 1 2 3
>>
>> Basically you just need an API like:
>>
>> ShellAddScriptingLanguage (L".py", L"python3.efi");
>>
>> Seems like this could just plug into the Shell via a ShellExecute(). So for
>> example you could make Python a UEFI Shell command via a library and that
>> library constructor could also teach the shell that a .py file could be an
>> executable?
>>
>> Thanks,
>>
>> Andrew Fish
>>
>>
>>
>>
>>
>>
>>
>>
>
next prev parent reply other threads:[~2020-02-12 2:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-10 20:11 Shell feature? Andrew Fish
2020-02-11 20:28 ` [edk2-devel] " Tim Lewis
2020-02-11 21:30 ` Jim Dailey
2020-02-12 1:30 ` Carsey, Jaben
2020-02-12 2:08 ` Andrew Fish [this message]
2020-02-12 6:04 ` Carsey, Jaben
[not found] ` <8A8C80EA-FDD7-4AF6-896C-7A7263446D62@apple.com>
2020-02-15 1:30 ` Andrew Fish
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1FCC7027-A508-4891-8400-3CDD3B371E34@apple.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox