First stab at stdlib https://github.com/nushell/nushell/pull/8150
nu-cmd-lang update
Pick one of the following lines of code to drive everything in src/main.rs
use nu_cmd_lang::create_default_context;
or
use nu_command::create_default_context;
Step 1 will be to leave nu_command crate name alone until everything has been
running and people in the community have tested the code for awhile
and then do the global search and replace from nu_command to nu_cmd_shell later
new-alias
to test, fix stack overflow of command calling itself (to enable alias ls = (ls | sort-by type name -i)
pattern as command)alias
, rename new-alias
to alias
#!
: https://github.com/nushell/nushell/pull/8101#!
would be skipped by the lexer (i.e., not appear in help messages)
how to ship it?
include_str!
env.nu
/config.nu
Strict guidelines
Test framework for nu
nu.scope
nu-cmd-lang
help
as well to get startedls
open
is a super basic command
shell
specific
nu-table
or jt-table
with the base distro?nu-cmd-shell
open
+ some cool data commands + viewers for the interactivecan we make alias
just a short hand to define a custom command that executes the long form
works fine for basic alias
similar logic for external wrapping reused
Get's rid of the bug prone span manipulation when translating back and forth in code and completion
currently new-alias
for the next release
if nothing pokes out we can replace the old alias
Alternative old-alias
as this would force users to test it (seems to be the vote)
Disadvantages:
Additional flags:
def inner[--foo, --bar] {
if $foo { ... }
if $bar { ... }
}
def outer[--foo, --bar] {
if $foo and $bar {
inner --foo --bar
if $foo and (not $bar) {
inner --foo
} else if (not $foo) and $bar {
inner --bar
} else {
inner
}
}
def outer[--foo, --bar] {
inner($foo, $bar)
# same as
inner(foo: $foo, bar: $bar)
}
Disadvantage: Two command call syntaxes
def outer[--foo, --bar] {
inner --foo=$foo --bar=$bar
}
Disadvantage: No short-form syntax
def outer[..-flags] {
inner $flags
}
Disadvantage: We lose signature information (help outer
) and static type checking.
//
vs ///
with #!
and #
for non-documented and documentedor
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing