Commit Graph

296 Commits

Author SHA1 Message Date
Jakub Žádník
72daf8c64e
Fix reporting of which and $nu.scope (#4836)
* Refactor & fix which

Instead of fetching all definitions / aliases, only show the one that is
visible.

* Fix $nu.scope to show only visible definitions

* Add missing tests file; Rename one which test
2022-03-13 21:32:46 +02:00
JT
ff3dffd813
Nu glob (#4818)
* Fork glob. Normalise license holder

* Fix more licenses

* unwraps

* bad doc test
2022-03-13 11:30:27 -07:00
Darren Schroeder
0ff9cc679e
add $nu.pid (#4828) 2022-03-12 10:54:59 -06:00
Darren Schroeder
ccc85a2979
remove $nu.cwd (#4824) 2022-03-12 09:11:19 -06:00
Jakub Žádník
90b2ec537f
Do not pass non-string env vars to externals (#4748)
* Do not pass non-string env vars to externals

Also misc cleanup

* Add note to default config

* Add a test

* Ensure PATH/Path conversion list <-> string
2022-03-12 00:18:39 +02:00
JT
12bf23faa6
Move completions to DeclId (#4801)
* Move completions to DeclId

* fmt

* fmt
2022-03-10 09:49:02 +02:00
JT
2ac990655e
Add support for var decl spans (#4787) 2022-03-09 04:42:19 -05:00
JT
1837bf775c
Default values (#4770) 2022-03-07 15:08:56 -05:00
JT
0b6b321ad6
More nuon tests, fix table print (#4762) 2022-03-07 08:39:02 -05:00
JT
9c17c73d5f
Add more exit code support (#4730) 2022-03-04 17:46:18 -05:00
JT
e64ca97fe2
move scope variable into nu variable (#4725) 2022-03-04 11:36:11 -05:00
Jakub Žádník
d90b7953dd
Use Nushell's PATH in which (#4690)
* Make which use our path instead of std::env

* Unignore which test

* Fix wrong fn signature without which feature
2022-03-03 10:38:31 +02:00
JT
88d7b50e37
Pass redirects into call (#4694)
* Pass redirects into call

* Oops, format
2022-03-02 07:52:24 -05:00
JT
a6a96b29cb
Add binary literals (#4680) 2022-02-28 18:31:53 -05:00
JT
7819210037
Add shortcircuiting boolean operators (#4668) 2022-02-27 17:02:53 -05:00
JT
4b18fdcc6e
Date literals (#4619)
* Date literals

* update deps

* Add date+duration
2022-02-23 21:02:48 -05:00
JT
676457acd3
Better ls paths (#4612)
* Fix ls paths... again

* Fix ls paths... again

* Always expand paths inside of glob_from

* Expand in ls before we check for directory info
2022-02-23 10:54:47 -05:00
JT
9888f8f298
Add pipeline redirection support (#4594)
* redirection

* Remove commented-out

* fix tests

* more fixes
2022-02-21 17:22:21 -05:00
JT
2ba12afb01
A few fixes to docs generation and default config (#4570)
* A few fixes to docs generation and default config

* A few more fixes
2022-02-20 15:20:41 -05:00
Jakub Žádník
56aacc4852
Use environment variable for env_conversions (#4566)
* Handle string->value env conv. with env. var.

Also adds the environment variable for Path/PATH and removes it from
config.

* Simplify getting the string->value conversion

* Refactor env conversion into its own function

* Use env var for to_string conversion; Remove conf

* Fix indentation in default config
2022-02-20 16:27:59 +02:00
JT
a32ce93c79
Improve full help for flags (#4559) 2022-02-19 21:25:52 -05:00
Darren Schroeder
9415352447
remove $nu.keybinding-path (#4515) 2022-02-17 14:36:08 -05:00
JT
f5f9d56c37
Move to a standard kebab/snake style (#4509) 2022-02-17 09:55:17 -05:00
JT
56b3fc61a3
Remove statements, replaced by pipelines (#4482) 2022-02-15 14:31:14 -05:00
JT
8c0a2d3c15
Auto-generate markdown command docs (#4451)
* Finish updating

* a couple improvements

* Update renames

* cleanup examples
2022-02-13 21:22:51 -05:00
Jakub Žádník
328f7e92a0
Hide alias (#4432)
* Add alias interning

Now, AliasId is used to reference aliases stored in EngineState, similar
to decls, blocks, etc.

* Fix wrong message

* Fix using decl instead of alias

* Extend also alias id visibility

* Merge also aliases from delta

* Add alias hiding code

Does not work yet but passes tests at least.

* Fix wrong alias lookup and visibility appending

* Add hide alias tests

* Fmt & Clippy

* Fix random clippy warnings in "which" command
2022-02-12 11:50:37 +02:00
JT
a16e485cce
Add support for defining known externals with their own custom completions (#4425)
* WIP for known externals

* Now completions can work from scripts

* Add support for definiing externs

* finish cleaning up old proof-of-concept
2022-02-11 13:38:10 -05:00
JT
c2118e7505
Fix help flag (#4398)
* Match 'help command' to 'command --help'

* Fix tests
2022-02-09 21:24:29 -05:00
JT
d70d91e559 Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
Fernando Herrera
fdce6c49ab engine-q merge 2022-02-07 19:11:34 +00:00
JT
a911b21256
Switch more commands to redirecting blocks (#956) 2022-02-05 21:03:06 -05:00
Jakub Žádník
fefd5fef12
Allow def-env to hide environment variables (#921) 2022-02-04 20:02:03 +02:00
JT
a008f1aa80
Command tests (#922)
* WIP command tests

* Finish marking todo tests

* update

* update

* Windows cd test ignoring
2022-02-03 21:01:45 -05:00
JT
cc1b784e3d
Add initial nu-test-support port (#913)
* Add initial nu-test-support port

* finish changing binary name

* Oops, these aren't Windows-safe tests
2022-02-02 15:59:01 -05:00
Darren Schroeder
004d7b5ff0
query command with json, web, xml (#870)
* query command with json, web, xml

* query xml now working

* clippy

* comment out web tests

* Initial work on query web

For now we can query everything except tables

* Support for querying tables

Now we can query multiple tables just like before, now the only thing
missing is the test coverage

* finish off

* comment out web test

Co-authored-by: Luccas Mateus de Medeiros Gomes <luccasmmg@gmail.com>
2022-02-01 12:45:48 -06:00
JT
44821d9941
Add support for def-env and export def-env (#887) 2022-01-29 15:45:46 -05:00
JT
65ae3160ca
Variables should error on use rather than value span (#881) 2022-01-29 08:00:48 -05:00
JT
4c029d2545
Automatically trim ends of stdin/stdout strings (#874) 2022-01-28 16:59:00 -05:00
JT
78b5da8255
Allow let/let-env to see custom command input (#854) 2022-01-27 06:00:25 +11:00
JT
83ec374995
Add -c flag and others to cmdline args (#853)
* Add -c flag and others to cmdline args

* finish a little bit of cleanup

* Oops, forgot file
2022-01-26 12:26:43 -05:00
JT
8ee619954d
Start support for commandline args to nu itself (#851)
* cmdline args wip

* WIP

* redirect working

* Add help and examples

* Only show flags in signature of more than help
2022-01-27 01:42:39 +11:00
JT
62e9698b11
Allow external args to expand globs (#839)
* Allow external args to expand globs

* WIP

* A bit of cleanups and refactor to glob_from

* oops, add file
2022-01-25 05:26:56 +11:00
JT
3d0b1ef1ce
Highlight help tutor (#838)
* WIP

* Syntax highlight help, add tutor
2022-01-25 02:05:19 +11:00
JT
525ed7653f
Add var vals and alias expansions to scope var (#837)
* Add var vals and alias expansions to scope var

* Fix test
2022-01-25 01:19:38 +11:00
Michael Angerman
8a1b2d0812
fix several cases where sort-by was crashing engine-q (#836) 2022-01-23 20:52:19 -08:00
JT
f562a4526c
Fix clippy lints (#4262)
* Fix clippy lints

* Fix clippy lints

* Fix clippy lints
2022-01-18 23:33:28 +11:00
Jakub Žádník
3b4baa31b6
Fix ls relative path & command argument path expansion (#757)
* Switch to short-names when the path is a relative_path (a dir) and exit with an error if the path does not exist

* Remove debugging print line

* Show relative filenames... It does not work yet for ls ../

* Try something else to fix relative paths... it works, but the ../ code part is not very pretty

* Add canonicalize check and remove code clones

* Fix the canonicalize_with issue pointed out by kubouch. Not sure the prefix_str is what kubouch suggested

* Fix the canonicalize_with issue pointed out by kubouch. Not sure the prefix_str is what kubouch suggested

* Add single-dot expansion to nu-path

* Move value path expansion from parser to eval

Fixes #745

* Remove single dot expansion from parser

It is not necessary since it will get expanded anyway in the eval.

* Fix ls to display globs with relative paths

* Use pathdiff crate to get relative paths for ls

Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
2022-01-17 00:55:56 +11:00
JT
82d90f4930
Add support for var/string interp for external names (#729) 2022-01-13 19:17:45 +11:00
JT
186da4d725
Fixing captures (#723)
* WIP fixing captures

* small fix

* WIP

* Rewrite to proof-of-concept better parse_def

* Add missing file

* Finish capture refactor

* Fix tests

* Add more tests
2022-01-12 15:06:56 +11:00
JT
3478f35330
Default the values of named params (#695) 2022-01-07 07:32:47 +11:00