Continuing on anchoring and improvements on Nu's overall internal commands (#2635).
`move column` sub command has been turned into the command `move` since
we use it to move exclusively columns. Examples added as well.
Fixed it to carry along any anchor locations that might be in place if
table to be moved originates from other sources.
* Add parser improvements
Previously everything starting with "$" was parsed as a column path.
With this commit applied, the lite_arg starting with $ is parsed as
the most appropriate thing
- $true/$false ==> Expression::Boolean
- $(...) ==> Invocation
- $it ==> ColumnPath
- Anything with at least one '.' ==> ColumnPath
- Anything else ==> Variable
* Ignore failing tests
* refactor and cleanup to md
* Add padding around values in each row
* Add padding to test
* Update code to satisfy Clippy and pass other failing tests
* make sort-by fail gracefully if mismatched types are compared
* Added a test to check if sorted-by with invalid types exists gracefully
* Linter changes
* removed redundant pattern matching
* Changed the error message
* Added a comma after every argument
* Changed the test to accomodate the new err messages
* Err message for sort-by invalid types now shows the mismatched types
* Lints problems
* Changed unwrap to expect
* Added the -f flag to rm command
Now when you a use rm -f there will be no error message, even if the
file doesnt actually exist
* Lint problems
* Fixed the wrong line
* Removed println
* Spelling mistake
* Fix problems when you mv a file into itself
* Lint mistakes
* Remove unecessary filtering in most cases
* Allow the removal of sockets
* Conditional compilations to systems without socket
* Add a size-format option to ls command
* Added kib and mib formating
* Make patterns lowercase
* New subcommand to format, filesize
* Forgot the linter once more
* Remove the ls changes since its no longer needed
* CI mistakes
* Lint stuff
* Fix lint
* Added formatting for bytes
* fix lint
* Changed the usage comment
* First draft for adding a `pretty` flag to `to md`
* rustfmt
* Fix Clippy warnings
* rustfmt
* Using Clippy suggestion broken code, reverting and putting in a statement to ignore clippy warning
* Add test for `to md -p`
* xpath prototype
* new xpath engine is finally working
* nearly there
* closer
* working with list, started to add test, code cleanup
* broken again
* working again - time for some cleanup
* cleaned up code, added error handling and test
* update example, fix clippy
* removed commented char
* make sort-by fail gracefully if mismatched types are compared
* Added a test to check if sorted-by with invalid types exists gracefully
* Linter changes
* removed redundant pattern matching
* Changed the error message
* Added a comma after every argument
* Changed the test to accomodate the new err messages
* Err message for sort-by invalid types now shows the mismatched types
* Lints problems
* Changed unwrap to expect
* Added the -f flag to rm command
Now when you a use rm -f there will be no error message, even if the
file doesnt actually exist
* Lint problems
* Fixed the wrong line
* Removed println
* Spelling mistake
* Fix problems when you mv a file into itself
* Lint mistakes
* Remove unecessary filtering in most cases
* First commit updating `config` to use subcommands (#2119)
- Implemented `get` subcommand
* Implmented `config set` as a subcommand.
* Implemented `config set_into` as subcommand
* Fixed base `config` command
- Instead of outputting help, it now outputs the list of all
configuration parameters.
* Added `config clear` subcommand
* Added `config load` and `config remove` subcommands
* Added `config path` subcommand
* fixed clippy
* initial commit for implementing groups
* each group works
* each group is slightly cleaner + added example
* Added `each window` subcommand
- No support for stride flag yet
* each window stride implemented
* Added tests and minor documentation changes
* fixed clippy
* fixed clippy again
* fixed: .*.(ext|*)
* ls **/* does not return hidden files without the -a flag
* fixed formatting
* fixed clippy issues
* fixed clippy issues, v2
* added `#[cfg(unix)]` to windows-failing test
* Allow the calculation of bytes and int.
* fix clippy.
* minimal implement the into_into command.
* Revert "fix clippy."
This reverts commit 0d7cf72ed2.
* Revert "Allow the calculation of bytes and int."
This reverts commit 9c4e3787f5.
* set the argument to any type.
* if the argument is an int, return it with no change in value.
* add tests for into-int command.
* fix a faild test.
* make sort-by fail gracefully if mismatched types are compared
* Added a test to check if sorted-by with invalid types exists gracefully
* Linter changes
* removed redundant pattern matching
* Changed the error message
* Added a comma after every argument
* Changed the test to accomodate the new err messages
* Err message for sort-by invalid types now shows the mismatched types
* Lints problems
* Changed unwrap to expect
* added various case conversion commands for str. Added the inflection crate as a dependency
* lighten the restriction on the inflector dependency
* publishing the case commands
* fix typo
* fix kebab case test
* formatting
* Changed time units as outlined in issue #2353.
Also applied changes to to_str for Unit - not sure if that was what was wanted.
* Forgot the tests!
* Updated primitive.rs to match changes.
* Updated where example to match changes.
* And the html test!
* Remove `with-symlink-targets` flag from `ls`
* Fix test to use `ls -l` to output all the columns of `ls`
* Fix error message
* Delete test that originally covered `ls -w`
* add 228 json html themes
removed old assets, added new zipped asset
added --list to get a list of the theme names
reworked some older theme code
added rust-embed and zip crate
removed the dark tests
* fmt
* Updated, removed excess comments
Changed usage a bit
Updated the error handling
Added some helper items in --list
Refactored out most of internal work for summarizing data opening
the door for generating charts from it. A model is introduced
to hold information needed for a summary, Histogram command is
an example of a partial usage. This is the beginning.
Removed implicit arithmetic traits on Value and Primitive to avoid
mixed types panics. The std operations traits can't fail and we
can't guarantee that. We can handle gracefully now since compute_values
was introduced after the parser changes four months ago. The handling
logic should be taken care of either explicitly or in compute_values.
The zero identity trait was also removed (and implementing this forced
us to also implement Add, Mult, etc)
Also: the `math` operations now remove in the output if a given column is not computable:
```
> ls | math sum
──────┬──────────
size │ 150.9 KB
──────┴──────────
```
* added campbell theme to html colors
* updated test results. had to make change for ci.
* hopefully the last changes for this stupid test :)
* moved tests to html.rs
* remove unnecessary using statement.
* still fighting with tests and tests are winning.
* Rename `calc` to `math eval` and allow it to optionally take the expression as an argument
* Moved calc tests to math eval
Also added 2 tests and changed 1 test
* Move calc docs to math eval
* Working towards a PoC for wasm
* Move bson and sqlite to plugins
* proof of concept now working
* tests are green
* Add CI test for --no-default-features
* Fix some tests
* Fix clippy and windows build
* More fixes
* Fix the windows build
* Fix the windows test
* add human, precision commands
* add 'str from' subcommand (converted from human/precision commands)
move human tests to str from
* add default locale, platform-specific SystemLocale use
* fix platform specific num-format dependency, remove invalid test
* change 'str from' localization to static num_format::Locale::en
* minor cleanup, nudge ci
* re-attempt ci
* Add args in .nurc file to environment
* Working dummy version
* Add add_nurc to sync_env command
* Parse .nurc file
* Delete env vars after leaving directory
* Removing vals not working, strangely
* Refactoring, add comment
* Debugging
* Debug by logging to file
* Add and remove env var behavior appears correct
However, it does not use existing code that well.
* Move work to cli.rs
* Parse config directories
* I am in a state of distress
* Rename .nurc to .nu
* Some notes for me
* Refactoring
* Removing vars works, but not done in a very nice fashion
* Refactor env_vars_to_delete
* Refactor env_vars_to_add()
* Move directory environment code to separate file
* Refactor from_config
* Restore env values
* Working?
* Working?
* Update comments and change var name
* Formatting
* Remove vars after leaving dir
* Remove notes I made
* Rename config function
* Clippy
* Cleanup and handle errors
* cargo fmt
* Better error messages, remove last (?) unwrap
* FORMAT PLZ
* Rename whitelisted_directories to allowed_directories
* Add comment to clarify how overwritten values are restored.
* Change list of allowed dirs to indexmap
* Rewrite starting
* rewrite everything
* Overwritten env values tracks an indexmap instead of vector
* Refactor restore function
* Untrack removed vars properly
* Performance concerns
* Performance concerns
* Error handling
* Clippy
* Add type aliases for String and OsString
* Deletion almost works
* Working?
* Error handling and refactoring
* nicer errors
* Add TODO file
* Move outside of loop
* Error handling
* Reworking adding of vars
* Reworking adding of vars
* Ready for testing
* Refactoring
* Restore overwritten vals code
* todo.org
* Remove overwritten values tracking, as it is not needed
* Cleanup, stop tracking overwritten values as nu takes care of it
* Init autoenv command
* Initialize autoenv and autoenv trust
* autoenv trust toml
* toml
* Use serde for autoenv
* Optional directory arg
* Add autoenv untrust command
* ... actually add autoenv untrust this time
* OsString and paths
* Revert "OsString and paths"
This reverts commit e6eedf8824.
* Fix path
* Fix path
* Autoenv trust and untrust
* Start using autoenv
* Check hashes
* Use trust functionality when setting vars
* Remove unused code
* Clippy
* Nicer errors for autoenv commands
* Non-working errors
* Update error description
* Satisfy fmt
* Errors
* Errors print, but not nicely
* Nicer errors
* fmt
* Delete accidentally added todo.org file
* Rename direnv to autoenv
* Use ShellError instead of Error
* Change tests to pass, danger zone?
* Clippy and errors
* Clippy... again
* Replace match with or_else
* Use sha2 crate for hashing
* parsing and error msg
* Refactoring
* Only apply vars once
* if parent dir
* Delete vars
* Rework exit code
* Adding works
* restore
* Fix possibility of infinite loop
* Refactoring
* Non-working
* Revert "Non-working"
This reverts commit e231b85570.
* Revert "Revert "Non-working""
This reverts commit 804092e46a.
* Autoenv trust works without restart
* Cargo fix
* Script vars
* Serde
* Serde errors
* Entry and exitscripts
* Clippy
* Support windows and handle errors
* Formatting
* Fix infinite loop on windows
* Debugging windows loop
* More windows infinite loop debugging
* Windows loop debugging #3
* windows loop #4
* Don't return err
* Cleanup unused code
* Infinite loop debug
* Loop debugging
* Check if infinite loop is vars_to_add
* env_vars_to_add does not terminate, skip loop as test
* Hypothesis: std::env::current_dir() is messing with something
* Hypothesis: std::env::current_dir() is messing with something
* plz
* make clippy happy
* debugging in env_vars_to_add
* Debbuging env_vars_to_add #2
* clippy
* clippy..
* Fool clippy
* Fix another infinite loop
* Binary search for error location x)
* Binary search #3
* fmt
* Binary search #4
* more searching...
* closing in... maybe
* PLZ
* Cleanup
* Restore commented out functionality
* Handle case when user gives the directory "."
* fmt
* Use fs::canonicalize for paths
* Create optional script section
* fmt
* Add exitscripts even if no entryscripts are defined
* All sections in .nu-env are now optional
* Re-read config file each directory change
* Hot reload after autoenv untrust, don't run exitscripts if untrusted
* Debugging
* Fix issue with recursive adding of vars
* Thank you for finding my issues Mr. Azure
* use std::env
* Stuff column with nothing if we have nothing
* Stuff columns at the very start
Remove unnecessary else clauses.
Add the unix cfg portion
* Added some tests and cfg windows
Not sure how I feel about these tests but it's better than nothing
* Types lined up for open with stream
* Chunking stream
* Maybe I didn't need most of the Stream stuff after all?
* Some clean-up
* Merge weird cargo.lock
* Start moving some encoding logic to MaybeTextCodec
Will we lose the nice table formatting if we Stream? How do we get it back? Collect the Stream at the end?
* Clean-up and small refinements
* Put in auto-convert workaround
* Workaround to make sure bat functionality works
* Handle some easy error cases
* All tests pass
* Remove guessing logic
* Address clippy comments
* Pull latest master and fix MaybeTextCodec usage
* Add tag to enable autoview
* Add bool subcommand to random
* Fix function name copy paste error
* Fix issue 2062: allow deserialization of a decimal
* Add bias flag to `random bool`
* uniq: Add counting option (WIP!)
Usage:
fetch https://raw.githubusercontent.com/timbray/topfew/master/test/data/access-1k | lines | wrap item | uniq | sort-by count | last 10
* uniq: Add first test
* uniq: Re-enable the non-counting variant.
* uniq: Also handle primitive lines.
* uniq: Update documentation
* uniq: Final comment about error handling. Let's get some feedback
* uniq: Address review comments.
Not happy with the way I create a TypeError. There must be a cleaner
way. Anyway, good for shipping.
* uniq: Use Labeled_error as suggested by jturner in chat.
* uniq: Return error directly.
Co-authored-by: Christoph Siedentop <christoph@siedentop.name>
* Move sum tests into math directory
* Move sum documentation over to math documentation
One sum example already existed in the math examples and a few of the others were outdated and didn't work, so I only moved one over, and updated their output
* Remove no-longer-in-use mod statement
* Add support to allow the week day start in cal to be configurable
* Fix variable name
* Use a flag instead of a configuration setting for specifying the starting day of the week
* Add 'every' command
* Add --skip option to 'every' command
This option skips instead of selects every nth row
* Fix descriptions for 'every' command
* Add docummentation for 'every' command
* Check actual filenames in 'every' command tests
* Converting average.rs to math.rs
* Making some progress towards math
Examples and unit tests failing, also think I found a bug with passing in strings
* Fix typos
* Found issue with negative numbers
* Add some comments
* Split commands like in split and str_ but do not register?
* register commands in cli
* Address clippy warnings
* Fix bad examples
* Make the example failure message more helpful
* Replace unwraps
* Use compare_values to avoid coercion issues
* Remove unneeded code
* WIP - not compiling
* compiling but panicing
* still broken
* nearly working
* reverted deserializer_string changes
updated enter.rs and open.rs to use Option<Tagged<String>>
Accepted Clippy suggestions
Accepted fmt suggestions
Left original code from open.rs
We may want to use some of it and only fallback to encoding.
* Don't exit when there is an unknown encoding.
* When encoding is unknown default to utf-8.
* only do encoding if the user says to it
* merged some conflicts on open
* made error messages consistent
* Updated unwrap with expect
* updated open test to pass with more descriptive err
updated enter test to not fail
* change _location to location
* changed _visitor to visitor
* Added a more verbose usage statement for encoding
Linked to docs.rs/encoding_rs for details
Co-authored-by: Darren Schroeder <fdncred@hotmail.com>