diff --git a/.gitignore b/.gitignore index 84bf662d1a2..6240da8b10b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,21 @@ -.temp/ -.cache/ -.DS_Store -node_modules -npm-debug.log -.vuepress/dist/ +# build output +dist/ +# generated types +.astro/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* -# ignore the git mailmap file -.mailmap + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store diff --git a/.prettierignore b/.prettierignore index f0002ae865d..7c2f7ecb68a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,12 +1,33 @@ +# build output +dist +# generated types +.astro + +# dependencies node_modules -package-lock.json - -operators.md -dataframes.md -nushell_map.md -*_bash*.md -commands/docs/*.md -.vuepress/.temp -.vuepress/.cache -.vuepress/dist/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store + +# files +**/*.js +**/*.ts +**/*.cjs +**/*.mjs +**/*.json +**/*.yaml +**/*.yml +!package.json +!tsconfig.json +!src/content/docs/book/coming-to-nu/coming_from_bash.md diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 544138be456..00000000000 --- a/.prettierrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "singleQuote": true -} diff --git a/.prettierrc.mjs b/.prettierrc.mjs new file mode 100644 index 00000000000..7e619305dc7 --- /dev/null +++ b/.prettierrc.mjs @@ -0,0 +1,12 @@ +/** @type {import("prettier").Config} */ +export default { + plugins: ["prettier-plugin-astro"], + overrides: [ + { + files: "*.astro", + options: { + parser: "astro", + }, + }, + ], +}; diff --git a/.typos.toml b/.typos.toml index c281b7ef1bc..b6653900376 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1,8 +1,13 @@ [files] -extend-exclude = ["pt-BR", "de", "ja", "es", "book/commands"] +extend-exclude = ["pt-BR", "de", "ja", "es", "blog/202[0-3]*"] [default.extend-words] # Avoid the false positive in book/commands/str_replace.md ons = "ons" +# Avoid false positive for json placeholder in cookbook/http.md +optio = "optio" +ratatui = "ratatui" +doas = "doas" +iterm = "iterm" nushell = "nushell" diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000000..22a15055d63 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,4 @@ +{ + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000000..d6422097621 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] +} diff --git a/.vuepress/client.js b/.vuepress/client.js deleted file mode 100755 index 8626e478dcf..00000000000 --- a/.vuepress/client.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Client app enhancement file. - * - * https://v2.vuepress.vuejs.org/advanced/cookbook/usage-of-client-config.html - */ - -import { defineClientConfig } from '@vuepress/client'; -import BlogPosts from './components/BlogPosts.vue'; - -export default defineClientConfig({ - enhance({ app }) { - app.component('BlogPosts', BlogPosts); - }, -}); diff --git a/.vuepress/components/BlogPosts.vue b/.vuepress/components/BlogPosts.vue deleted file mode 100644 index d64a6915842..00000000000 --- a/.vuepress/components/BlogPosts.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - diff --git a/.vuepress/config.js b/.vuepress/config.js deleted file mode 100755 index e9b225646c8..00000000000 --- a/.vuepress/config.js +++ /dev/null @@ -1,209 +0,0 @@ -import path from 'path'; -import { defineUserConfig } from '@vuepress/cli'; -import { gitPlugin } from '@vuepress/plugin-git'; -import { feedPlugin } from 'vuepress-plugin-feed2'; -import { shikiPlugin } from '@vuepress/plugin-shiki'; -import { defaultTheme } from '@vuepress/theme-default'; -import { sitemapPlugin } from 'vuepress-plugin-sitemap2'; -import { docsearchPlugin } from '@vuepress/plugin-docsearch'; -import { backToTopPlugin } from '@vuepress/plugin-back-to-top'; -import { mediumZoomPlugin } from '@vuepress/plugin-medium-zoom'; - -import { - navbarDe, - navbarEn, - navbarEs, - navbarJa, - navbarPtBR, - navbarRU, - navbarZhCN, - sidebarDe, - sidebarEn, - sidebarEs, - sidebarJa, - sidebarPtBR, - sidebarRU, - sidebarZhCN, -} from './configs/index.js'; - -const compareDate = (dateA, dateB) => { - if (!dateA || !(dateA instanceof Date)) return 1; - if (!dateB || !(dateB instanceof Date)) return -1; - - return dateB.getTime() - dateA.getTime(); -}; - -export default defineUserConfig({ - locales: { - '/': { - lang: 'English', - title: 'Nushell', - description: 'A new type of shell.', - }, - '/zh-CN/': { - lang: 'zh-CN', - title: 'Nushell', - description: '一种新型的Shell', - }, - '/de/': { - lang: 'Deutsch', - title: 'Nushell', - description: 'Eine neue Art von Shell.', - }, - '/es/': { - lang: 'es', - title: 'Nushell', - description: 'Un nuevo tipo de shell.', - }, - '/ja/': { - lang: 'ja', - title: 'Nushell', - description: '新しいタイプのシェル', - }, - '/pt-BR/': { - lang: 'pt-BR', - title: 'Nushell', - description: 'Um novo tipo de shell.', - }, - '/ru': { - lang: 'ru', - title: 'Nushell', - description: 'Новый тип оболочки.', - }, - }, - head: [ - ['meta', { name: 'theme-color', content: '#3eaf7c' }], - ['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }], - [ - 'meta', - { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }, - ], - ['link', { rel: 'icon', href: '/icon.png' }], - ], - markdown: { - code: { - lineNumbers: false, - }, - importCode: { - handleImportPath: (str) => - str.replace(/^@snippets/, path.resolve(__dirname, '../snippets')), - }, - }, - // without this, we attempt to prefetch the whole site 😬 - shouldPrefetch: false, - theme: defaultTheme({ - repo: 'nushell/nushell', - repoLabel: 'GitHub', - editLinks: true, - docsRepo: 'nushell/nushell.github.io', - docsBranch: 'main', - lastUpdated: false, - locales: { - '/': { - selectText: 'Languages', - selectLanguageName: 'English', - editLinkText: 'Edit this page on GitHub', - navbar: navbarEn, - sidebar: sidebarEn, - }, - '/de/': { - selectText: 'Sprachen', - selectLanguageName: 'Deutsch', - editLinkText: 'Diese Seite auf GitHub bearbeiten', - navbar: navbarDe, - sidebar: sidebarDe, - }, - '/es/': { - selectText: 'Idiomas', - selectLanguageName: 'Español', - editLinkText: 'Edita esta página en GitHub', - navbar: navbarEs, - sidebar: sidebarEs, - }, - '/ja/': { - selectText: '言語', - selectLanguageName: '日本語', - editLinkText: 'GitHubでこのページを編集する', - navbar: navbarJa, - sidebar: sidebarJa, - }, - '/pt-BR/': { - selectText: 'Línguas', - selectLanguageName: 'Português do Brasil', - editLinkText: 'Edite esta página no GitHub', - navbar: navbarPtBR, - sidebar: sidebarPtBR, - }, - '/ru': { - selectText: 'Языки', - selectLanguageName: 'Русский язык', - editLinkText: 'Отредактируйте эту страницу на GitHub', - navbar: navbarRU, - sidebar: sidebarRU, - }, - '/zh-CN/': { - selectText: '语言', - selectLanguageName: '中文', - editLinkText: '在GitHub上编辑此页面', - navbar: navbarZhCN, - sidebar: sidebarZhCN, - }, - }, - }), - plugins: [ - gitPlugin(), - backToTopPlugin(), - mediumZoomPlugin(), - shikiPlugin({ - theme: 'dark-plus', - langs: [ - 'nushell', - 'rust', - 'bash', - 'shell', - 'sh', - 'toml', - 'json', - 'python', - 'cpp', - 'powershell', - ], - }), - docsearchPlugin({ - appId: 'GHCTOYCW6T', - indexName: 'nushell', - apiKey: 'dd6a8f770a42efaed5befa429d167232', - }), - feedPlugin({ - rss: true, - json: true, - atom: true, - count: 30, - hostname: 'https://www.nushell.sh', - filter: ({ frontmatter, filePathRelative }) => { - return ( - frontmatter.feed === true || filePathRelative?.indexOf('blog/') >= 0 - ); - }, - sorter: (a, b) => { - return compareDate( - a.data.git?.createdTime - ? new Date(a.data.git?.createdTime) - : a.frontmatter.date, - b.data.git?.createdTime - ? new Date(b.data.git?.createdTime) - : b.frontmatter.date, - ); - }, - }), - sitemapPlugin({ - hostname: 'https://www.nushell.sh/', - }), - ], - onPrepared: async (app) => { - await app.writeTemp( - 'pages.js', - `export default ${JSON.stringify(app.pages.map(({ data }) => data))}`, - ); - }, -}); diff --git a/.vuepress/configs/index.ts b/.vuepress/configs/index.ts deleted file mode 100644 index e9323f1da3c..00000000000 --- a/.vuepress/configs/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './navbar/index.js'; -export * from './sidebar/index.js'; diff --git a/.vuepress/configs/navbar/de.ts b/.vuepress/configs/navbar/de.ts deleted file mode 100644 index ce03892a4b3..00000000000 --- a/.vuepress/configs/navbar/de.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarDe: NavbarConfig = [ - { text: 'Buch', link: '/de/book/' }, - // { text: "Contributor Book", link: "/contributor-book/" }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: 'Blog', link: '/blog/' }, -]; diff --git a/.vuepress/configs/navbar/en.ts b/.vuepress/configs/navbar/en.ts deleted file mode 100644 index 1db569c200d..00000000000 --- a/.vuepress/configs/navbar/en.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarEn: NavbarConfig = [ - { text: 'Book', link: '/book/' }, - // { text: "Contributor Book", link: "/contributor-book/" }, - { text: 'Commands', link: '/commands/' }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: 'Blog', link: '/blog/' }, - { text: 'Ref', link: '/lang-guide/' }, -]; diff --git a/.vuepress/configs/navbar/es.ts b/.vuepress/configs/navbar/es.ts deleted file mode 100644 index c80a28b016a..00000000000 --- a/.vuepress/configs/navbar/es.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarEs: NavbarConfig = [ - { text: 'Libro', link: '/es/book/' }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: 'Blog', link: '/blog/' }, -]; diff --git a/.vuepress/configs/navbar/index.ts b/.vuepress/configs/navbar/index.ts deleted file mode 100644 index 5703043d438..00000000000 --- a/.vuepress/configs/navbar/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './de.js'; -export * from './en.js'; -export * from './es.js'; -export * from './ja.js'; -export * from './pt-BR.js'; -export * from './ru.js'; -export * from './zh-CN.js'; diff --git a/.vuepress/configs/navbar/ja.ts b/.vuepress/configs/navbar/ja.ts deleted file mode 100644 index 8821e24ef56..00000000000 --- a/.vuepress/configs/navbar/ja.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarJa: NavbarConfig = [ - { text: 'Book', link: '/ja/book/' }, - // { text: "Contributor Book", link: "/contributor-book/" }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: 'Blog', link: '/blog/' }, -]; diff --git a/.vuepress/configs/navbar/pt-BR.ts b/.vuepress/configs/navbar/pt-BR.ts deleted file mode 100644 index 388373a5a05..00000000000 --- a/.vuepress/configs/navbar/pt-BR.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarPtBR: NavbarConfig = [ - { text: 'Livro', link: '/pt-BR/book/' }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: 'Blog', link: '/blog/' }, -]; diff --git a/.vuepress/configs/navbar/ru.ts b/.vuepress/configs/navbar/ru.ts deleted file mode 100644 index 46305040115..00000000000 --- a/.vuepress/configs/navbar/ru.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarRU: NavbarConfig = [ - { text: 'Книга', link: '/ru/book/' }, - // { text: "Contributor Book", link: "/contributor-book/" }, - { text: 'Команды', link: '/commands/' }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: 'Блог', link: '/blog/' }, -]; diff --git a/.vuepress/configs/navbar/zh-CN.ts b/.vuepress/configs/navbar/zh-CN.ts deleted file mode 100644 index a46745f3e13..00000000000 --- a/.vuepress/configs/navbar/zh-CN.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { NavbarConfig } from '@vuepress/theme-default'; - -export const navbarZhCN: NavbarConfig = [ - { text: '书', link: '/zh-CN/book/' }, - // { text: "Contributor Book", link: "/contributor-book/" }, - { text: 'Cookbook', link: '/cookbook/' }, - { text: '博客', link: '/blog/' }, -]; diff --git a/.vuepress/configs/sidebar/command_categories.ts b/.vuepress/configs/sidebar/command_categories.ts deleted file mode 100644 index dad4c818bfa..00000000000 --- a/.vuepress/configs/sidebar/command_categories.ts +++ /dev/null @@ -1,34 +0,0 @@ -export const commandCategories = [ - '/commands/categories/bits.md', - '/commands/categories/bytes.md', - '/commands/categories/chart.md', - '/commands/categories/conversions.md', - '/commands/categories/core.md', - '/commands/categories/database.md', - '/commands/categories/dataframe.md', - '/commands/categories/dataframe_or_lazyframe.md', - '/commands/categories/date.md', - '/commands/categories/debug.md', - '/commands/categories/default.md', - '/commands/categories/env.md', - '/commands/categories/expression.md', - '/commands/categories/filesystem.md', - '/commands/categories/filters.md', - '/commands/categories/formats.md', - '/commands/categories/generators.md', - '/commands/categories/hash.md', - '/commands/categories/history.md', - '/commands/categories/lazyframe.md', - '/commands/categories/math.md', - '/commands/categories/misc.md', - '/commands/categories/network.md', - '/commands/categories/path.md', - '/commands/categories/platform.md', - '/commands/categories/prompt.md', - '/commands/categories/random.md', - '/commands/categories/removed.md', - '/commands/categories/shells.md', - '/commands/categories/strings.md', - '/commands/categories/system.md', - '/commands/categories/viewers.md', -]; diff --git a/.vuepress/configs/sidebar/de.ts b/.vuepress/configs/sidebar/de.ts deleted file mode 100644 index 3667f4f9870..00000000000 --- a/.vuepress/configs/sidebar/de.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; -import type { commandCategories } from './command_categories'; - -export const sidebarDe: SidebarConfig = { - '/de/book/': [ - { - text: 'Einleitung', - link: '/de/book/README.md', - collapsible: false, - }, - { - text: 'Erste Schritte', - link: '/de/book/getting_started.md', - collapsible: false, - children: [ - '/de/book/installation', - '/de/book/moving_around', - '/de/book/thinking_in_nushell', - ], - }, - { - text: 'Nu Grundlagen', - link: '/de/book/nu_fundamentals.md', - collapsible: false, - children: [ - '/de/book/types_of_data', - '/de/book/loading_data', - '/de/book/pipeline.md', - '/de/book/working_with_strings', - '/de/book/working_with_lists', - '/de/book/working_with_tables', - ], - }, - { - text: 'Programmieren in Nu', - link: '/de/book/programming_in_nu.md', - collapsible: false, - children: [ - '/de/book/custom_commands', - '/de/book/aliases', - '/de/book/operators', - '/de/book/variables_and_subexpressions.md', - '/de/book/scripts', - '/de/book/overlays', - '/de/book/command_signature', - ], - }, - { - text: 'Nu als Shell', - link: '/de/book/nu_as_a_shell.md', - collapsible: false, - children: [ - '/de/book/configuration', - '/de/book/environment', - '/de/book/escaping', - '/de/book/3rdpartyprompts', - '/de/book/custom_completions', - '/de/book/coloring_and_theming', - '/de/book/hooks', - '/de/book/background_task.md', - ], - }, - { - text: 'Wechsel zu Nu', - link: '/de/book/coming_to_nu.md', - collapsible: false, - children: ['/de/book/coming_from_bash', '/de/book/command_reference'], - }, - { - text: '(Nicht nur für) Fortgeschrittene', - link: '/de/book/advanced.md', - collapsible: false, - children: ['/de/book/plugins', '/de/book/metadata.md'], - }, - ], -}; diff --git a/.vuepress/configs/sidebar/en.ts b/.vuepress/configs/sidebar/en.ts deleted file mode 100644 index d364eda9187..00000000000 --- a/.vuepress/configs/sidebar/en.ts +++ /dev/null @@ -1,161 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; -import { commandCategories } from './command_categories'; - -export const sidebarEn: SidebarConfig = { - '/book/': [ - { - text: 'Introduction', - link: '/book/README.md', - collapsible: false, - }, - { - text: 'Getting Started', - link: '/book/getting_started.md', - collapsible: false, - children: [ - '/book/installation.md', - '/book/default_shell.md', - '/book/quick_tour.md', - '/book/moving_around.md', - '/book/thinking_in_nu.md', - '/book/cheat_sheet.md', - ], - }, - { - text: 'Nu Fundamentals', - link: '/book/nu_fundamentals.md', - collapsible: false, - children: [ - '/book/types_of_data.md', - '/book/loading_data.md', - '/book/pipelines.md', - '/book/working_with_strings.md', - '/book/working_with_lists.md', - '/book/working_with_tables.md', - ], - }, - { - text: 'Programming in Nu', - link: '/book/programming_in_nu.md', - collapsible: false, - children: [ - '/book/custom_commands.md', - '/book/aliases.md', - '/book/operators.md', - '/book/variables_and_subexpressions.md', - '/book/control_flow.md', - '/book/scripts.md', - '/book/modules.md', - '/book/overlays.md', - '/book/command_signature.md', - '/book/testing.md', - '/book/style_guide.md', - ], - }, - { - text: 'Nu as a Shell', - link: '/book/nu_as_a_shell.md', - collapsible: false, - children: [ - '/book/configuration.md', - '/book/environment.md', - '/book/stdout_stderr_exit_codes.md', - '/book/escaping.md', - '/book/3rdpartyprompts.md', - '/book/shells_in_shells.md', - '/book/line_editor.md', - '/book/externs.md', - '/book/custom_completions.md', - '/book/coloring_and_theming.md', - '/book/hooks.md', - '/book/background_task.md', - ], - }, - { - text: 'Coming to Nu', - link: '/book/coming_to_nu.md', - collapsible: false, - children: [ - '/book/coming_from_bash.md', - '/book/coming_from_cmd.md', - '/book/nushell_map.md', - '/book/nushell_map_imperative.md', - '/book/nushell_map_functional.md', - '/book/nushell_operator_map.md', - ], - }, - { - text: 'Design Notes', - link: '/book/design_notes.md', - collapsible: false, - children: ['/book/how_nushell_code_gets_run.md'], - }, - { - text: '(Not So) Advanced', - link: '/book/advanced.md', - collapsible: false, - children: [ - '/book/standard_library.md', - '/book/dataframes.md', - '/book/metadata.md', - '/book/creating_errors.md', - '/book/parallelism.md', - '/book/plugins.md', - '/book/explore.md', - ], - }, - ], - '/commands/': [ - { - text: 'Categories', - collapsible: false, - children: commandCategories, - }, - ], - '/contributor-book/': [ - { - text: 'Contributor Book', - link: '/contributor-book/README.md', - collapsible: false, - children: [ - 'README.md', - 'philosophy', - 'philosophy_0_80', - 'commands', - 'plugins', - ], - }, - ], - '/cookbook/': [ - { - text: 'Cookbook', - collapsible: false, - children: [ - 'README.md', - 'setup', - 'help', - 'system', - 'parsing', - 'pattern_matching', - 'external_completers', - 'files', - 'git', - 'parsing_git_log', - 'http', - 'direnv', - 'ssh_agent', - 'tables', - 'polars_v_pandas_v_nushell', - 'jq_v_nushell', - ], - }, - ], - '/lang-guide/': [ - { - text: 'Language Reference Guide', - link: '/lang-guide/README.md', - collapsible: false, - children: ['README.md', 'lang-guide.md'], - }, - ], -}; diff --git a/.vuepress/configs/sidebar/es.ts b/.vuepress/configs/sidebar/es.ts deleted file mode 100644 index e602f5ecf24..00000000000 --- a/.vuepress/configs/sidebar/es.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; - -export const sidebarEs: SidebarConfig = { - '/es/book/': [ - { - text: 'Nu Libro', - collapsible: false, - children: [ - 'README.md', - 'instalacion', - 'explorando', - 'tipos_de_datos', - 'cargando_datos', // "trabajando_con_listas" - 'trabajando_con_tablas', - 'pipeline', - 'configuracion', // "custom_commands" - 'aliases', // "operadores" - 'matematicas', // "variables_y_subexpresiones" - 'entorno', // "scripts" - 'metadatos', - 'shells_en_shells', - 'escapando', - 'plugins', // "dataframes" - 'llegando_de_bash', - 'mapa_nushell', - 'mapa_imperativo_nushell', - 'mapa_funcional_nushell', - 'mapa_operador_nushell', - '/book/command_reference.md', - ], - }, - ], -}; diff --git a/.vuepress/configs/sidebar/index.ts b/.vuepress/configs/sidebar/index.ts deleted file mode 100644 index 5703043d438..00000000000 --- a/.vuepress/configs/sidebar/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './de.js'; -export * from './en.js'; -export * from './es.js'; -export * from './ja.js'; -export * from './pt-BR.js'; -export * from './ru.js'; -export * from './zh-CN.js'; diff --git a/.vuepress/configs/sidebar/ja.ts b/.vuepress/configs/sidebar/ja.ts deleted file mode 100644 index 3053cd02d59..00000000000 --- a/.vuepress/configs/sidebar/ja.ts +++ /dev/null @@ -1,107 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; -// import { commandCategories } from './command_categories'; - -export const sidebarJa: SidebarConfig = { - '/ja/book/': [ - { - text: 'はじめに', - link: '/ja/book/README.md', - collapsible: false, - }, - { - text: 'Getting Started', - link: '/ja/book/getting_started.md', - collapsible: false, - children: [ - '/ja/book/installation.md', - '/book/default_shell.md', - '/ja/book/quick_tour.md', - '/ja/book/moving_around.md', - '/book/thinking_in_nu.md', - '/book/cheat_sheet.md', - ], - }, - { - text: 'Nu 基礎編', - link: '/ja/book/nu_fundamentals.md', - collapsible: false, - children: [ - '/ja/book/types_of_data.md', - '/ja/book/loading_data.md', - '/ja/book/pipeline.md', - '/book/working_with_strings.md', - '/book/working_with_lists.md', - '/ja/book/working_with_tables.md', - ], - }, - { - text: 'Programming in Nu', - link: '/ja/book/programming_in_nu.md', - collapsible: false, - children: [ - '/book/custom_commands.md', - '/ja/book/aliases.md', - '/book/operators.md', - '/book/variables_and_subexpressions.md', - '/book/scripts.md', - '/book/modules.md', - '/book/overlays.md', - '/book/command_signature.md', - '/book/testing.md', - '/book/style_guide.md', - ], - }, - { - text: 'シェルとしての Nu', - link: '/ja/book/nu_as_a_shell.md', - collapsible: false, - children: [ - '/ja/book/configuration.md', - '/ja/book/environment.md', - '/book/stdout_stderr_exit_codes.md', - '/ja/book/escaping.md', - '/book/3rdpartyprompts.md', - '/ja/book/shells_in_shells.md', - '/book/line_editor.md', - '/book/externs.md', - '/book/custom_completions.md', - '/book/coloring_and_theming.md', - '/book/hooks.md', - '/book/background_task.md', - ], - }, - { - text: 'Nu への移行', - link: '/ja/book/coming_to_nu.md', - collapsible: false, - children: [ - '/ja/book/coming_from_bash.md', - '/book/coming_from_cmd.md', - '/ja/book/nushell_map.md', - '/ja/book/nushell_map_imperative.md', - '/ja/book/nushell_map_functional.md', - '/ja/book/nushell_operator_map.md', - ], - }, - { - text: 'Design Notes', - link: '/ja/book/design_notes.md', - collapsible: false, - children: ['/book/how_nushell_code_gets_run.md'], - }, - { - text: '(Not So) Advanced', - link: '/ja/book/advanced.md', - collapsible: false, - children: [ - '/book/standard_library.md', - '/book/dataframes.md', - '/ja/book/metadata.md', - '/book/creating_errors.md', - '/book/parallelism.md', - '/ja/book/plugins.md', - '/book/explore.md', - ], - }, - ], -}; diff --git a/.vuepress/configs/sidebar/pt-BR.ts b/.vuepress/configs/sidebar/pt-BR.ts deleted file mode 100644 index 3a4dba3250a..00000000000 --- a/.vuepress/configs/sidebar/pt-BR.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; - -export const sidebarPtBR: SidebarConfig = { - '/pt-BR/book/': [ - { - text: 'Nu Livro', - collapsible: false, - children: [ - 'instalacao', - 'introducao', - 'explorando', - 'tipos_de_dados', - 'carregando_dados', - 'trabalhando_com_tabelas', - 'pipeline', - 'line_editor', - 'metadados', - 'shells_em_shells', - 'escapando', - 'plugins', - ], - }, - ], -}; diff --git a/.vuepress/configs/sidebar/ru.ts b/.vuepress/configs/sidebar/ru.ts deleted file mode 100644 index 7720a5a3bae..00000000000 --- a/.vuepress/configs/sidebar/ru.ts +++ /dev/null @@ -1,110 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; -import { commandCategories } from './command_categories'; - -export const sidebarRU: SidebarConfig = { - '/ru/book/': [ - { - text: 'Введение', - link: '/ru/book/README.md', - collapsible: false, - }, - // { - // text: 'Начало работы', - // link: '/ru/book/getting_started.md', - // collapsible: false, - // children: [ - // '/ru/book/installation.md', - // '/ru/book/default_shell.md', - // '/ru/book/quick_tour.md', - // '/ru/book/moving_around.md', - // '/ru/book/thinking_in_nu.md', - // '/ru/book/cheat_sheet.md', - // ], - // }, - // { - // text: 'Основы Nu', - // link: '/nu_fundamentals.md', - // collapsible: false, - // children: [ - // '/ru/book/types_of_data.md', - // '/ru/book/loading_data.md', - // '/ru/book/pipelines.md', - // '/ru/book/working_with_strings.md', - // '/ru/book/working_with_lists.md', - // '/ru/book/working_with_tables.md', - // ], - // }, - // { - // text: 'Программирование в Nu', - // link: '/programming_in_nu.md', - // collapsible: false, - // children: [ - // '/ru/book/custom_commands.md', - // '/ru/book/aliases.md', - // '/ru/book/operators.md', - // '/ru/book/variables_and_subexpressions.md', - // '/ru/book/control_flow.md', - // '/ru/book/scripts.md', - // '/ru/book/modules.md', - // '/ru/book/overlays.md', - // '/ru/book/command_signature.md', - // '/ru/book/testing.md', - // '/ru/book/style_guide.md', - // ], - // }, - // { - // text: 'Nu как оболочка', - // link: '/nu_as_a_shell.md', - // collapsible: false, - // children: [ - // '/ru/book/configuration.md', - // '/ru/book/environment.md', - // '/ru/book/stdout_stderr_exit_codes.md', - // '/ru/book/escaping.md', - // '/ru/book/3rdpartyprompts.md', - // '/ru/book/shells_in_shells.md', - // '/ru/book/line_editor.md', - // '/ru/book/externs.md', - // '/ru/book/custom_completions.md', - // '/ru/book/coloring_and_theming.md', - // '/ru/book/hooks.md', - // '/ru/book/background_task.md', - // ], - // }, - // { - // text: 'Переход в Nu', - // link: '/coming_to_nu.md', - // collapsible: false, - // children: [ - // '/ru/book/coming_from_bash.md', - // '/ru/book/coming_from_cmd.md', - // '/ru/book/nushell_map.md', - // '/ru/book/nushell_map_imperative.md', - // '/ru/book/nushell_map_functional.md', - // '/ru/book/nushell_operator_map.md', - // ], - // }, - // { - // text: 'Примечания к дизайну', - // link: '/design_notes.md', - // collapsible: false, - // children: [ - // '/ru/book/how_nushell_code_gets_run.md' - // ], - // }, - // { - // text: '(Не очень) Продвинутый', - // link: '/advanced.md', - // collapsible: false, - // children: [ - // '/ru/book/standard_library.md', - // '/ru/book/dataframes.md', - // '/ru/book/metadata.md', - // '/ru/book/creating_errors.md', - // '/ru/book/parallelism.md', - // '/ru/book/plugins.md', - // '/ru/book/explore.md', - // ], - // }, - ], -}; diff --git a/.vuepress/configs/sidebar/zh-CN.ts b/.vuepress/configs/sidebar/zh-CN.ts deleted file mode 100644 index 960bc73e59e..00000000000 --- a/.vuepress/configs/sidebar/zh-CN.ts +++ /dev/null @@ -1,81 +0,0 @@ -import type { SidebarConfig } from '@vuepress/theme-default'; - -export const sidebarZhCN: SidebarConfig = { - '/zh-CN/book/': [ - { - text: '入门篇', - collapsible: false, - children: [ - 'README.md', - 'installation', - 'thinking_in_nu', - 'moving_around', - ], - }, - { - text: 'Nu 基础篇', - collapsible: false, - children: [ - 'types_of_data', - 'loading_data', - 'working_with_strings', - 'working_with_lists', - 'working_with_tables', - 'pipelines', - 'command_reference', - ], - }, - { - text: 'Nushell 编程', - collapsible: false, - children: [ - 'custom_commands', - 'aliases', - 'operators', - 'variables_and_subexpressions', - 'scripts', - 'modules', - 'overlays', - ], - }, - { - text: 'Nu 作为 Shell 使用', - collapsible: false, - children: [ - 'configuration', - 'environment', - 'stdout_stderr_exit_codes', - 'escaping', - '3rdpartyprompts', - 'shells_in_shells', - 'line_editor', - 'externs', - 'custom_completions', - 'coloring_and_theming', - 'hooks.md', - ], - }, - { - text: '迁移到 Nu', - collapsible: false, - children: [ - 'coming_from_bash', - 'nushell_map', - 'nushell_map_imperative', - 'nushell_map_functional', - 'nushell_operator_map', - ], - }, - { - text: '高级篇', - collapsible: false, - children: [ - 'dataframes', - 'metadata', - 'creating_errors', - 'parallelism', - 'plugins', - ], - }, - ], -}; diff --git a/.vuepress/public/icon.png b/.vuepress/public/icon.png deleted file mode 100644 index d5cf15428e5..00000000000 Binary files a/.vuepress/public/icon.png and /dev/null differ diff --git a/.vuepress/styles/index.scss b/.vuepress/styles/index.scss deleted file mode 100755 index bc09eb16627..00000000000 --- a/.vuepress/styles/index.scss +++ /dev/null @@ -1,46 +0,0 @@ -.navbar .navbar-items-wrapper { - flex-direction: row-reverse; -} - -.command-title { - margin-top: 15px; - white-space: pre-wrap; -} - -/* Reduce line height in code blocks - * to avoid gaps in tables rendered with box-drawing characters - */ -.theme-default-content pre, -.theme-default-content pre[class*=language-] { - line-height: 1; -} - -/* Add DejaVu Sans Mono to the list of monospaced fonts. - * This allows tables to be rendered seamlessly with box-drawing characters. - */ -:root { - --font-family-code: Consolas, Monaco, 'Andale Mono', 'DejaVu Sans Mono', 'Ubuntu Mono', monospace; -} - -@media screen and (min-width: 720px) and (max-width: 815px) { - #docsearch-container { - width: 150px; - } - button.toggle-color-mode-button { - margin-right: 20px; - margin-left: 20px; - } -} - -@media screen and (min-width: 816px) { - #docsearch-container { - width: 239px; - .DocSearch-Button-Container { - width: 150px; - } - } - - button.toggle-color-mode-button { - margin-right: 30px; - } -} diff --git a/.vuepress/styles/palette.scss b/.vuepress/styles/palette.scss deleted file mode 100755 index d9d86da65d9..00000000000 --- a/.vuepress/styles/palette.scss +++ /dev/null @@ -1,4 +0,0 @@ -$accentColor: #3eaf7c; -$textColor: #2c3e50; -$borderColor: #eaecef; -$codeBgColor: #282c34; diff --git a/README.md b/README.md index 19b9e1e467d..4af41779ca9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ features: ### Nu works with existing data -Nu speaks [JSON, YAML, SQLite, Excel, and more](/book/loading_data.html) out of the box. It's easy to bring data into a Nu pipeline whether it's in a file, a database, or a web API: +Nu speaks [JSON, YAML, SQLite, Excel, and more](/book/loading_data) out of the box. It's easy to bring data into a Nu pipeline whether it's in a file, a database, or a web API: Screenshot showing fetch with a web API @@ -30,7 +30,7 @@ Nu operates on typed data, so it catches bugs that other shells don't. And when ## Get Nu -Nushell is available as [downloadable binaries](https://github.com/nushell/nushell/releases), [via your favourite package manager](https://repology.org/project/nushell/versions), in [a GitHub Action](https://github.com/marketplace/actions/setup-nu), and as [source code](https://github.com/nushell/nushell). Read [the detailed installation instructions](/book/installation.html) or dive right in: +Nushell is available as [downloadable binaries](https://github.com/nushell/nushell/releases), [via your favourite package manager](https://repology.org/project/nushell/versions), in [a GitHub Action](https://github.com/marketplace/actions/setup-nu), and as [source code](https://github.com/nushell/nushell). Read [the detailed installation instructions](/book/installation) or dive right in: #### macOS / Linux: diff --git a/astro.config.mjs b/astro.config.mjs new file mode 100644 index 00000000000..a3b4a52a4ca --- /dev/null +++ b/astro.config.mjs @@ -0,0 +1,113 @@ +import fs from "node:fs"; +import starlight from "@astrojs/starlight"; +import { ExpressiveCodeTheme } from "@astrojs/starlight/expressive-code"; +import { defineConfig } from "astro/config"; + +const jsoncString = fs.readFileSync( + new URL("./public/nushell_minimal_dark_theme.json", import.meta.url), + "utf-8", +); +const nushellTheme = ExpressiveCodeTheme.fromJSONString(jsoncString); + +// https://astro.build/config +export default defineConfig({ + site: "https://www.nushell.sh/", + integrations: [ + starlight({ + title: "Nushell Docs", + defaultLocale: "root", + locales: { + root: { + label: "English", + lang: "en", + }, + "zh-cn": { + label: "简体中文", + lang: "zh-CN", + }, + es: { + label: "Español", + }, + ja: { + label: "日本語", + }, + pt: { + label: "Português", + }, + ru: { + label: "Русский", + }, + de: { + label: "Deutsch", + }, + }, + expressiveCode: { + themes: [nushellTheme], + }, + editLink: { + baseUrl: "https://github.com/nushell/nushell.github.io/edit/master/", + }, + customCss: ["./src/styles/index.css"], + logo: { + src: "./src/assets/images/nu_icon.png", + }, + social: { + github: "https://github.com/nushell/nushell", + discord: "https://discord.gg/NtAbbGn", + }, + sidebar: [ + { + label: "Book", + collapsed: true, + items: [ + { + label: "Getting Started", + translations: { pt: "Comece Aqui" }, + collapsed: true, + autogenerate: { directory: "/book/getting-started" }, + }, + { + label: "Nu Fundamentals", + collapsed: true, + autogenerate: { directory: "/book/nu-fundamentals" }, + }, + { + label: "Programming in Nu", + collapsed: true, + autogenerate: { directory: "/book/programming-in-nu" }, + }, + { + label: "Nu as a Shell", + collapsed: true, + autogenerate: { directory: "/book/nu-as-a-shell" }, + }, + { + label: "Coming to Nu", + collapsed: true, + autogenerate: { directory: "/book/coming-to-nu" }, + }, + { + label: "(Not so) Advanced", + collapsed: true, + autogenerate: { directory: "/book/advanced" }, + }, + ], + }, + { + label: "Command Reference", + collapsed: true, + link: "/commands/", + }, + { + label: "Cookbook", + collapsed: true, + autogenerate: { directory: "/cookbook/" }, + }, + { + label: "Blog", + link: "/blog/", + }, + ], + }), + ], +}); diff --git a/biome.json b/biome.json new file mode 100644 index 00000000000..a61694f408a --- /dev/null +++ b/biome.json @@ -0,0 +1,26 @@ +{ + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "formatter": { + "enabled": true, + "indentStyle": "space" + }, + "files": { + "ignoreUnknown": true, + "ignore": [ + "dist/", + ".vercel/", + ".astro/", + "./public/*json", + "./src/content/docs/book/coming_from_bash.md" + ] + } +} diff --git a/blog/2023-07-25-nushell_0_83.md b/blog/2023-07-25-nushell_0_83.md deleted file mode 100644 index 497b1bbd17f..00000000000 --- a/blog/2023-07-25-nushell_0_83.md +++ /dev/null @@ -1,451 +0,0 @@ ---- -title: Nushell 0.83 -author: The Nu Authors -author_site: https://twitter.com/nu_shell -author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.83 of Nu. This release adds match guards, stronger type checking features, unit testing improvements, flexible variable initializations, and more. ---- - -# Nushell 0.83 - -Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. - -Today, we're releasing version 0.83 of Nu. This release adds match guards, stronger type checking features, unit testing improvements, flexible variable initializations, and more. - - - -# Where to get it - -Nu 0.83 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.83.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. - -NOTE: The optional dataframe functionality is available by `cargo install nu --features=dataframe`. - -As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_`. - -# Themes of this release / New features - -## Fixes, stabilization and shoutouts - -| Name | Link | Description | -| ------------------------------------------------------ | ---------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| [@WindSoilder](https://github.com/WindSoilder) | [9747](https://github.com/nushell/nushell/pull/9747) | Redirection: make `o>`, `e>`, `o+e>`'s target support variables and string interpolation | -| [@kubouch](https://github.com/kubouch) | [9679](https://github.com/nushell/nushell/pull/9679) | Fix broken constants in scopes | -| [@rusty-jules](https://github.com/rusty-jules) | [9594](https://github.com/nushell/nushell/pull/9594) | Fix: return all headers with the same name from `http ` | -| [@baehyunsol](https://github.com/baehyunsol) | [9582](https://github.com/nushell/nushell/pull/9582) | make the behaviours of `last` and `first` more consistent | -| [@hanjunghyuk](https://github.com/hanjunghyuk) | [9623](https://github.com/nushell/nushell/pull/9623) | Fix `explore` crashes on {} | -| [@YassineHaouzane](https://github.com/YassineHaouzane) | [9616](https://github.com/nushell/nushell/pull/9616) | Fix: update engine_state when history.isolation is true (#9268) | -| [@IanManske](https://github.com/IanManske) | [9603](https://github.com/nushell/nushell/pull/9603) | Fix `headers` command handling of missing values | -| [@AyushSingh13](https://github.com/AyushSingh13) | [9580](https://github.com/nushell/nushell/pull/9580) | fixes `which` showing aliases as built-in nushell commands | -| [@mengsuenyan](https://github.com/mengsuenyan) | [9662](https://github.com/nushell/nushell/pull/9662) | fix the command `cp -u src dst`/`mv -u src dst` doesn't work when the… | - -## Changes to commands -Since last release, some commands have changed and some have been created, here is a list of some changes and what they mean: -- [@amtoine](https://github.com/amtoine) in [#9646]: `which` returns the type of the command instead of only whether it is builtin or not and uses more explicit column names -- [@atahabaki](https://github.com/atahabaki) in [#9750]: `str expand` now allows empty member in *brace expansion*, e.g. `A{,B,C}` would expand to `[A, AB, AC]` -- [@fdncred](https://github.com/fdncred) in [#9669]: `keybinding listen` gives more information about keys like `home` and `end`, namely their `kind` and `state` -- [@NotLebedev](https://github.com/NotLebedev) in [#9453]: `input listen` allows to query for a single key press, e.g. the following will take a 4-char input `1..4 | each { input listen } | where key_type == char | get code | str join` -- [@kubouch](https://github.com/kubouch) in [#9687]: `path` commands lose the `-c` flag; instead, use `update` to update table columns - -[#9646]: https://github.com/nushell/nushell/pull/9646 -[#9750]: https://github.com/nushell/nushell/pull/9750 -[#9669]: https://github.com/nushell/nushell/pull/9669 -[#9453]: https://github.com/nushell/nushell/pull/9453 -[#9687]: https://github.com/nushell/nushell/pull/9687 - -## Command set refinement efforts -Again with this new release, we are continuing refining our set of core commands. As part of this, another set of commands have moved to `extra`. Thanks to folks who are helping our efforts on the road to 1.0! - -> **Note** -> No command has been removed completely, they have just been moved in the *extra* feature of Nushell. -> simply use `cargo ... --features extra` to reenable them. - -Math commands have been moved by [@stormasm] in [#9674], [#9657] and [#9647] and the following -commands have been moved in [#9404]: `fmt`, `each while`, `roll`, `roll down`, `roll left`, `roll right`, -`roll up`, `rotate`, `update cells`, `decode hex`, `encode hex`, `from url`, `to html`, `ansi gradient`, -`ansi link`and `format` - -[@stormasm]: https://github.com/stormasm -[#9674]: https://github.com/nushell/nushell/pull/9674 -[#9657]: https://github.com/nushell/nushell/pull/9657 -[#9647]: https://github.com/nushell/nushell/pull/9647 -[#9404]: https://github.com/nushell/nushell/pull/9404 - -## Language improvements -Since last release, a few changes have happened to the Nu language itself. - -### Declaration and assignment of variables -Until now, declaration keywords such as `let` and `mut` have required the use of parentheses around pipelines to assign the output of a chain of command to a variable. -Thanks to [@jntrnr] in [#9658] and [#9589], this syntax has been relaxed for `let` and `mut`. Let's give some examples! -```nushell -let filenames = ls | where type == file | get name -``` -and -```nushell -mut my_var = "hello world" | str length -``` -are now completely valid Nushell code. - -> **Note** -> this new syntax does not work on `const` and it does not apply to assignment of values to variables, e.g. -> ```nushell -> $env.FILENAMES = ls | where type == file | get name -> ``` -> is not parsed as valid Nushell. - -Another parser improvement has to do with the use of `if` and `match` in variable assignment. -In [#9650], [@Windsoilder] made the following Nushell snippets possible: -```nushell -mut a = 3 -$a = if 4 == 3 { 10 } else {20} -``` -and -```nushell -$env.BUILD_EXT = match 3 { 1 => { 'yes!' }, _ => { 'no!' } } -``` - -[@jntrnr]: https://github.com/jntrnr -[#9658]: https://github.com/nushell/nushell/pull/9658 -[#9589]: https://github.com/nushell/nushell/pull/9589 -[@Windsoilder]: https://github.com/Windsoilder -[#9650]: https://github.com/nushell/nushell/pull/9650 - -### Input / output type checking and annotations ([@jntrnr]) -Nushell as a language is more strictly typed than other shell languages. -However, not everything was type-checked nor possible to annotate and this new release tries to fill this gap a bit more. - -> **Note** -> in the following of this section, the term *input / output signature* is used. This describes the input of a command -> and the associated output type of the command for the given input type, e.g. in `ls | get 0.name` the input type of -> `get` is a `table` and its output type is a `string`, so we can say that the *input / output signature* of `get` here -> is `table -> string`. -> -> Please note that *input / output signatures* always come in pair. - -First, [#9686] makes the input / output type signatures clearer in the help pages of commands. -Then, [#9690] and [#9680] enable input / output type annotations on custom commands and enforce a strong type checking -on the input and output of commands. -This means a few things -- the input / output of custom commands can be annotated -```nushell -def sum []: list -> int { - math sum -} -``` -- some type-invalid calls to commands are now parsed as an error, e.g. `123 | get foo` gives the following error -```nushell -Error: nu::parser::input_type_mismatch - - × Command does not support int input. - ╭─[entry #2:1:1] - 1 │ 123 | get foo - · ─┬─ - · ╰── command doesn't support int input - ╰──── -``` - -This is still a work in progress, so some commands might have incorrect or missing input / output type annotations :open_mouth: -This is expected and we worked and are working on this to fix all incorrect signatures ([#9755], [#9749], [#9707], [#9706], [#9695], -[#9683], [#9775], [#9741], [#9742], [#9739] and [#9778])! - -[@jntrnr]: https://github.com/jntrnr -[#9686]: https://github.com/nushell/nushell/pull/9686 -[#9690]: https://github.com/nushell/nushell/pull/9690 -[#9680]: https://github.com/nushell/nushell/pull/9680 -[#9755]: https://github.com/nushell/nushell/pull/9755 -[#9749]: https://github.com/nushell/nushell/pull/9749 -[#9707]: https://github.com/nushell/nushell/pull/9707 -[#9706]: https://github.com/nushell/nushell/pull/9706 -[#9695]: https://github.com/nushell/nushell/pull/9695 -[#9683]: https://github.com/nushell/nushell/pull/9683 -[#9775]: https://github.com/nushell/nushell/pull/9775 -[#9741]: https://github.com/nushell/nushell/pull/9741 -[#9742]: https://github.com/nushell/nushell/pull/9742 -[#9739]: https://github.com/nushell/nushell/pull/9739 -[#9778]: https://github.com/nushell/nushell/pull/9778 - -### Shoutouts -In between the two releases, [@1Kinoti](https://github.com/1Kinoti) has worked on some nice improvements to the language -- match guards have been added to the `match` command in [#9621](https://github.com/nushell/nushell/pull/9621) -- `table` types can now have parameters, just as `record`s and `list`s can, thansk to [#9613](https://github.com/nushell/nushell/pull/9613) -- structural subtyping has been improved in [#9614](https://github.com/nushell/nushell/pull/9614) and allow to match structured types regardless of the orders of the fields - -## Configuration tweaks -Contributions have been made to give a more consistent and sensible default experience in Nushell, both when using -the `default_config.nu` config file or when not having a config, e.g. with `nu -n`. -A better right prompt has been written in [#9585] and [#9581] and the default configuration has been polished in [#9676]. - -[#9585]: https://github.com/nushell/nushell/pull/9585 -[#9581]: https://github.com/nushell/nushell/pull/9581 -[#9676]: https://github.com/nushell/nushell/pull/9676 - -## The standard library -The biggest topic in this 0.83 release for the standard library has been the test runner! - -Thanks to [@Yethal], the test runner of the standard library can now use annotations to decide whether or not to run -a command as part of the test suite of a project: [#9628], [#9622], [#9611] and [#9406]. - -For instance, we can now write a module as follows -```nushell -def add [a: int, b: int] { - $a + $b -} - -#[test] -def addition [] { - use std assert - assert equal (add 1 2) 3 -} -``` -and `std testing run-tests` would successfully run the `addition` test, no need to define tests with `test_` in their names! - -Thanks to [@Hofer-Julian] ([#9607]), the standard library now also comes with a `pwd` command that tells you were you are in -the filesystem. - -[@Yethal]: https://github.com/Yethal -[@Hofer-Julian]: https://github.com/Hofer-Julian -[#9628]: https://github.com/nushell/nushell/pull/9628 -[#9622]: https://github.com/nushell/nushell/pull/9622 -[#9611]: https://github.com/nushell/nushell/pull/9611 -[#9406]: https://github.com/nushell/nushell/pull/9406 -[#9607]: https://github.com/nushell/nushell/pull/9607 - -# Breaking changes - -**PLEASE NOTE:** there are some big breaking changes in this release. These include: - -* Removal of `let-env` (now use the `$env.FOO = "BAR"` form instead) -* Stricter checking of input/output types -* Transitioning of a set of commands to now be avialable via `extra` feature rather than default - -Full list of breaking changes: -- [#9574](https://github.com/nushell/nushell/pull/9574) remove let-env, focus on mutating $env -- [#9587](https://github.com/nushell/nushell/pull/9587) disallow blocks as first-class values -- [#9589](https://github.com/nushell/nushell/pull/9589) `let` no longer allows bareword assignment (Eg, `let foo = bar` where `bar` is assumed to be a string) -- [#9582](https://github.com/nushell/nushell/pull/9582) make the behaviours of `last` and `first` more consistent -- [#9594](https://github.com/nushell/nushell/pull/9594) Fix: return all headers with the same name from `http ` -- [#9646](https://github.com/nushell/nushell/pull/9646) change the output of `which` to be more explicit -- [#9404](https://github.com/nushell/nushell/pull/9404) [#9647](https://github.com/nushell/nushell/pull/9647) [#9657](https://github.com/nushell/nushell/pull/9657) - a number of commands have been moved to `extra` -- [#9680](https://github.com/nushell/nushell/pull/9680) Input output checking -- [#9613](https://github.com/nushell/nushell/pull/9613) allow table types to have parameters -- [#9687](https://github.com/nushell/nushell/pull/9687) Refactor path commands -- [#9690](https://github.com/nushell/nushell/pull/9690) The `extern` command has split into `extern` and `extern-wrapped`, the latter allowing a block to be called when calling an extern - -# Full changelog -## Nushell -- [sholderbach](https://github.com/sholderbach) created - - [Adjust signatures for cellpath access of tables](https://github.com/nushell/nushell/pull/9778) - - [Update `nu-ansi-term`, `lscolors`, and `reedline`](https://github.com/nushell/nushell/pull/9787) - - [Abort type determination for List early](https://github.com/nushell/nushell/pull/9779) - - [Fix output signature of `split chars`/`words`](https://github.com/nushell/nushell/pull/9739) - - [Use explicit in/out list types for vectorized commands](https://github.com/nushell/nushell/pull/9742) - - [Add explicit input types for vectorized `into int` form](https://github.com/nushell/nushell/pull/9741) - - [Remove underused devdep `getset`](https://github.com/nushell/nushell/pull/9727) - - [Clean up tests containing unnecessary `cwd:` tokens](https://github.com/nushell/nushell/pull/9692) - - [Use `is-terminal` crate for now](https://github.com/nushell/nushell/pull/9670) - - [Bump deps to transitively use hashbrown 0.14](https://github.com/nushell/nushell/pull/9668) - - [Apply nightly clippy lints](https://github.com/nushell/nushell/pull/9654) - - [Update reedline dev version lock](https://github.com/nushell/nushell/pull/9644) - - [Bump `indexmap` to 2.0](https://github.com/nushell/nushell/pull/9643) - - [Remove duplicated dependency on `ansi-str 0.7`](https://github.com/nushell/nushell/pull/9641) - - [Update `proc-macro2` lock, fix nightly build](https://github.com/nushell/nushell/pull/9618) - - [Exclude deprecated commands from completions](https://github.com/nushell/nushell/pull/9612) - - [Document `fn pipeline()` used with `nu!` tests](https://github.com/nushell/nushell/pull/9609) - - [Remove unnecessary parentheses](https://github.com/nushell/nushell/pull/9605) -- [app/dependabot](https://github.com/app/dependabot) created - - [Bump pretty_assertions from 1.3.0 to 1.4.0](https://github.com/nushell/nushell/pull/9781) - - [Bump tempfile from 3.6.0 to 3.7.0](https://github.com/nushell/nushell/pull/9780) - - [Bump miette from 5.9.0 to 5.10.0](https://github.com/nushell/nushell/pull/9713) - - [Bump strum_macros from 0.24.3 to 0.25.1](https://github.com/nushell/nushell/pull/9714) - - [Bump strum from 0.24.1 to 0.25.0](https://github.com/nushell/nushell/pull/9639) - - [Bump scraper from 0.16.0 to 0.17.1](https://github.com/nushell/nushell/pull/9638) - - [Bump libproc from 0.13.0 to 0.14.0](https://github.com/nushell/nushell/pull/9640) - - [Bump tempfile from 3.5.0 to 3.6.0](https://github.com/nushell/nushell/pull/9591) - - [Bump calamine from 0.19.1 to 0.21.2](https://github.com/nushell/nushell/pull/9592) - - [Bump ureq from 2.6.2 to 2.7.1](https://github.com/nushell/nushell/pull/9590) - - [Bump open from 4.1.0 to 5.0.0](https://github.com/nushell/nushell/pull/9526) -- [amtoine](https://github.com/amtoine) created - - [add `table -> table` to `into datetime`](https://github.com/nushell/nushell/pull/9775) - - [change the output of `which` to be more explicit](https://github.com/nushell/nushell/pull/9646) - - [add `any -> record` to `metadata`](https://github.com/nushell/nushell/pull/9755) - - [sync default config / env with default behaviour without any configuration](https://github.com/nushell/nushell/pull/9676) - - [allow `into filesize` to take tables as input / output](https://github.com/nushell/nushell/pull/9706) - - [simplify the test for `let` core command](https://github.com/nushell/nushell/pull/9671) - - [fix the `std` test commands calls in dev documents](https://github.com/nushell/nushell/pull/9535) - - [refactor the CI](https://github.com/nushell/nushell/pull/9626) - - [REFACTOR: move the 0% commands to `nu-cmd-extra`](https://github.com/nushell/nushell/pull/9404) - - [simplify the `nu!` tests for `last` and `first` commands](https://github.com/nushell/nushell/pull/9608) -- [hexavik](https://github.com/hexavik) created - - [Fix: remove unnecessary `r#"..."#` (#8670)](https://github.com/nushell/nushell/pull/9764) -- [mengsuenyan](https://github.com/mengsuenyan) created - - [fix #9653 the cmd `detect columns` with the flag `-c`](https://github.com/nushell/nushell/pull/9667) - - [fix the command `cp -u src dst`/`mv -u src dst` doesn't work when the…](https://github.com/nushell/nushell/pull/9662) -- [IanManske](https://github.com/IanManske) created - - [Add functions for each `Value` case](https://github.com/nushell/nushell/pull/9736) - - [nushell should be non-interactive if `--testbin` is supplied](https://github.com/nushell/nushell/pull/9730) - - [Do not attempt to take control of terminal in non-interactive mode](https://github.com/nushell/nushell/pull/9693) - - [Fix SIGTTIN handling](https://github.com/nushell/nushell/pull/9681) - - [Fix `headers` command handling of missing values](https://github.com/nushell/nushell/pull/9603) -- [fdncred](https://github.com/fdncred) created - - [update history_isolation to false](https://github.com/nushell/nushell/pull/9763) - - [change the default of history.isolation](https://github.com/nushell/nushell/pull/9762) - - [handle sqlite tables better by surrounding with brackets](https://github.com/nushell/nushell/pull/9752) - - [add range input to par-each](https://github.com/nushell/nushell/pull/9749) - - [normalize default_config/env formatting](https://github.com/nushell/nushell/pull/9731) - - [allow range as a input_output_type on filter](https://github.com/nushell/nushell/pull/9707) - - [update rust toolchain to 1.69.0](https://github.com/nushell/nushell/pull/9691) - - [add more input_output_types found from breaking scripts](https://github.com/nushell/nushell/pull/9683) - - [add kind and state to other key presses](https://github.com/nushell/nushell/pull/9669) - - [fix right prompt in the default_env.nu](https://github.com/nushell/nushell/pull/9581) - - [fix typo in deprecated message: `$nu` should be `$env`](https://github.com/nushell/nushell/pull/9579) - - [update ide-check help text](https://github.com/nushell/nushell/pull/9559) - - [add input_output type to `input list` to return string](https://github.com/nushell/nushell/pull/9557) - - [convert a string to a raw binary string of 0s and 1s](https://github.com/nushell/nushell/pull/9534) - - [update sqlparser dep to 0.34](https://github.com/nushell/nushell/pull/9549) -- [atahabaki](https://github.com/atahabaki) created - - [str-expand: new capability, empty collection item](https://github.com/nushell/nushell/pull/9750) - - [A new subcommand to str, str-expand.](https://github.com/nushell/nushell/pull/9290) -- [jntrnr](https://github.com/jntrnr) created - - [Fix capture logic for inner closures](https://github.com/nushell/nushell/pull/9754) - - [fix input signature of let/mut](https://github.com/nushell/nushell/pull/9695) - - [Revert "Fix SIGTTIN handling"](https://github.com/nushell/nushell/pull/9694) - - [Custom command input/output types](https://github.com/nushell/nushell/pull/9690) - - [Change input/output types in help to a table](https://github.com/nushell/nushell/pull/9686) - - [Input output checking](https://github.com/nushell/nushell/pull/9680) - - [Remove broken compile-time overload system](https://github.com/nushell/nushell/pull/9677) - - [allow mut to take pipelines](https://github.com/nushell/nushell/pull/9658) - - [Move to using a safer shell integration default setting](https://github.com/nushell/nushell/pull/9600) - - [Let with pipeline](https://github.com/nushell/nushell/pull/9589) - - [disallow blocks as first-class values](https://github.com/nushell/nushell/pull/9587) - - [use an easier-to-read date format in prompt](https://github.com/nushell/nushell/pull/9585) - - [fix a few clippy issues](https://github.com/nushell/nushell/pull/9578) - - [remove let-env, focus on mutating $env](https://github.com/nushell/nushell/pull/9574) - - [Improve type hovers](https://github.com/nushell/nushell/pull/9515) -- [cramt](https://github.com/cramt) created - - [fix removing symlinks on windows](https://github.com/nushell/nushell/pull/9704) -- [WindSoilder](https://github.com/WindSoilder) created - - [Redirection: make `o>`, `e>`, `o+e>`'s target support variables and string interpolation](https://github.com/nushell/nushell/pull/9747) - - [support env assignment and mutable variable assignment with `if` block and `match` guard](https://github.com/nushell/nushell/pull/9650) - - [dependency: use notify-debouncer-full(based on notify v6) instead of notify v4](https://github.com/nushell/nushell/pull/9606) - - [Bracketed paste refactor](https://github.com/nushell/nushell/pull/9547) - - [fix cd permissions when user belongs to folder group](https://github.com/nushell/nushell/pull/9531) - - [`rename`: add -b flag to support closure input](https://github.com/nushell/nushell/pull/8948) -- [stormasm](https://github.com/stormasm) created - - [add in a Readme for the crate nu-cmd-extra](https://github.com/nushell/nushell/pull/9745) - - [remove warning: unused import pipeline](https://github.com/nushell/nushell/pull/9675) - - [cratification: part III of the math commands to nu-cmd-extra](https://github.com/nushell/nushell/pull/9674) - - [cratification: part II of the math commands to nu-cmd-extra](https://github.com/nushell/nushell/pull/9657) - - [cratification: start moving over the math commands to nu-cmd-extra](https://github.com/nushell/nushell/pull/9647) -- [dmatos2012](https://github.com/dmatos2012) created - - [Disallow empty record with empty key,value pairs on ini format](https://github.com/nushell/nushell/pull/9722) -- [nibon7](https://github.com/nibon7) created - - [Remove `is-root` crate](https://github.com/nushell/nushell/pull/9615) - - [Replace `users` with `nix` crate](https://github.com/nushell/nushell/pull/9610) - - [Fix cargo-build-nu](https://github.com/nushell/nushell/pull/9571) - - [Refactor cargo-build-nu](https://github.com/nushell/nushell/pull/9554) - - [Fix release workflows](https://github.com/nushell/nushell/pull/9542) -- [1Kinoti](https://github.com/1Kinoti) created - - [add match guards](https://github.com/nushell/nushell/pull/9621) - - [allow tables to have annotations](https://github.com/nushell/nushell/pull/9613) - - [improve subtyping](https://github.com/nushell/nushell/pull/9614) -- [kubouch](https://github.com/kubouch) created - - [Refactor path commands](https://github.com/nushell/nushell/pull/9687) - - [Fix broken constants in scopes](https://github.com/nushell/nushell/pull/9679) -- [zhiburt](https://github.com/zhiburt) created - - [nu-explore/ Add handlers for HOME/END keys](https://github.com/nushell/nushell/pull/9666) - - [Fix #9548](https://github.com/nushell/nushell/pull/9552) -- [hanjunghyuk](https://github.com/hanjunghyuk) created - - [Remove unnecessary `cwd`, `pipeline()`, `r#` from various tests](https://github.com/nushell/nushell/pull/9645) - - [Fix `explore` crashes on {}](https://github.com/nushell/nushell/pull/9623) -- [Yethal](https://github.com/Yethal) created - - [test-runner: add configurable threading](https://github.com/nushell/nushell/pull/9628) - - [test-runner: Performance improvements + regex match for test include/exclude](https://github.com/nushell/nushell/pull/9622) - - [test-runner: Add option to exclude single test and module](https://github.com/nushell/nushell/pull/9611) - - [Implement annotations support in test runner](https://github.com/nushell/nushell/pull/9406) - - [Pre-register plugins inside docker container](https://github.com/nushell/nushell/pull/9533) -- [AyushSingh13](https://github.com/AyushSingh13) created - - [fixes `which` showing aliases as built-in nushell commands](https://github.com/nushell/nushell/pull/9580) -- [YassineHaouzane](https://github.com/YassineHaouzane) created - - [Fix: update engine_state when history.isolation is true (#9268)](https://github.com/nushell/nushell/pull/9616) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [Add `pwd` command to stdlib](https://github.com/nushell/nushell/pull/9607) -- [NotLebedev](https://github.com/NotLebedev) created - - [Command to get individual keys](https://github.com/nushell/nushell/pull/9453) -- [rusty-jules](https://github.com/rusty-jules) created - - [Fix: return all headers with the same name from `http `](https://github.com/nushell/nushell/pull/9594) -- [baehyunsol](https://github.com/baehyunsol) created - - [make the behaviours of `last` and `first` more consistent](https://github.com/nushell/nushell/pull/9582) -- [bgmort](https://github.com/bgmort) created - - [Add useful example to `http options` documentation](https://github.com/nushell/nushell/pull/9576) - -## Extension -- [fdncred](https://github.com/fdncred) created - - [forgot to merge changes for 1.60](https://github.com/nushell/vscode-nushell-lang/pull/145) - -## Documentation -- [amtoine](https://github.com/amtoine) created - - [refactor `ssh-agent` cookbook example](https://github.com/nushell/nushell.github.io/pull/982) - - [remove all `| table` from the book](https://github.com/nushell/nushell.github.io/pull/976) - - [add a more complete example to persist aliases in `config.nu`](https://github.com/nushell/nushell.github.io/pull/973) -- [Heidar-An](https://github.com/Heidar-An) created - - [Update nushell_map_imperative.md](https://github.com/nushell/nushell.github.io/pull/986) -- [JoaquinTrinanes](https://github.com/JoaquinTrinanes) created - - [Add external completers cookbook entry to sidebar](https://github.com/nushell/nushell.github.io/pull/985) - - [Expand external completer docs](https://github.com/nushell/nushell.github.io/pull/984) -- [fachammer](https://github.com/fachammer) created - - [Fix link](https://github.com/nushell/nushell.github.io/pull/981) - - [Fix typo](https://github.com/nushell/nushell.github.io/pull/980) - - [Fix typo](https://github.com/nushell/nushell.github.io/pull/979) -- [hustcer](https://github.com/hustcer) created - - [Use lefthook instead of husky and lint-staged for git hooks](https://github.com/nushell/nushell.github.io/pull/978) - - [Refresh commands docs for Nu v0.82](https://github.com/nushell/nushell.github.io/pull/965) -- [Equationzhao](https://github.com/Equationzhao) created - - [fix a broken link in plugins page in zh-CN](https://github.com/nushell/nushell.github.io/pull/975) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [Remove `&&` and `||`](https://github.com/nushell/nushell.github.io/pull/974) -- [jarrodu](https://github.com/jarrodu) created - - [Fix typo](https://github.com/nushell/nushell.github.io/pull/971) -- [sholderbach](https://github.com/sholderbach) created - - [Automate response to PRs trying to update commands](https://github.com/nushell/nushell.github.io/pull/969) -- [waldyrious](https://github.com/waldyrious) created - - [Fix typo in 2023-06-27-nushell_0_82.md](https://github.com/nushell/nushell.github.io/pull/967) - -## Nu_Scripts -- [amtoine](https://github.com/amtoine) created - - [add `$.version` to `package.nuon`](https://github.com/nushell/nu_scripts/pull/548) - - [move the extra menus of Nushell into `custom-menus/extra/`](https://github.com/nushell/nu_scripts/pull/550) - - [make the release note TODOs HTML comments](https://github.com/nushell/nu_scripts/pull/557) - - [refactor: simplify the `nu_release` script](https://github.com/nushell/nu_scripts/pull/540) - - [fix the release note scripts](https://github.com/nushell/nu_scripts/pull/538) - - [update the `make_release/Readme.md` with the whole process](https://github.com/nushell/nu_scripts/pull/541) - - [use `$env.` instead of `let-env `](https://github.com/nushell/nu_scripts/pull/543) -- [jntrnr](https://github.com/jntrnr) created - - [Update some benchmarks. Re-port the gradient benchmark](https://github.com/nushell/nu_scripts/pull/558) -- [JalonWong](https://github.com/JalonWong) created - - [Add a git prompt](https://github.com/nushell/nu_scripts/pull/555) -- [fj0r](https://github.com/fj0r) created - - [ssh complete cache use whitelist](https://github.com/nushell/nu_scripts/pull/553) - - [upgrade to 0.82](https://github.com/nushell/nu_scripts/pull/539) -- [fdncred](https://github.com/fdncred) created - - [fix error background color in oh-my.nu script](https://github.com/nushell/nu_scripts/pull/551) -- [maxim-uvarov](https://github.com/maxim-uvarov) created - - [conda fix](https://github.com/nushell/nu_scripts/pull/547) -- [trantor](https://github.com/trantor) created - - [Update README.md: typo](https://github.com/nushell/nu_scripts/pull/545) -- [dedebenui](https://github.com/dedebenui) created - - [fix pass-completion as `let` cannot be used at module level](https://github.com/nushell/nu_scripts/pull/544) -- [bobhy](https://github.com/bobhy) created - - [full line v2; with git status!](https://github.com/nushell/nu_scripts/pull/542) - -## Reedline -- [sholderbach](https://github.com/sholderbach) created - - [Bump `nu-ansi-term` to 0.49.0](https://github.com/nushell/reedline/pull/613) - - [Update the `Cargo.lock` for tests and demo](https://github.com/nushell/reedline/pull/611) - - [Fix clippy lint for DoubleEndedIterator](https://github.com/nushell/reedline/pull/610) - - [Update (dev-)deps strum/pretty-assertions,rstest](https://github.com/nushell/reedline/pull/600) -- [nibon7](https://github.com/nibon7) created - - [Fix big_word_left_index](https://github.com/nushell/reedline/pull/609) - - [Remove unneeded features of chrono](https://github.com/nushell/reedline/pull/599) -- [NotLebedev](https://github.com/NotLebedev) created - - [Replace crossterm ScrollUp with universal workaround](https://github.com/nushell/reedline/pull/601) -- [WindSoilder](https://github.com/WindSoilder) created - - [always disable bracketed paste after read_line](https://github.com/nushell/reedline/pull/598) diff --git a/blog/2023-08-22-nushell_0_84_0.md b/blog/2023-08-22-nushell_0_84_0.md deleted file mode 100644 index 9158a94de8e..00000000000 --- a/blog/2023-08-22-nushell_0_84_0.md +++ /dev/null @@ -1,416 +0,0 @@ ---- -title: Nushell 0.84.0 -author: The Nu Authors -author_site: https://twitter.com/nu_shell -author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.84.0 of Nu. This release adds adds exporting constants from modules, `scope` commands improvements, cosmetic changes, and many smaller changes to our commands. ---- - -# Nushell 0.84.0 - -Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. - -Today, we're releasing version 0.84.0 of Nu. This release adds exporting constants from modules, `scope` commands improvements, cosmetic changes, and many smaller changes to our commands. - - - -# Where to get it - -Nu 0.84.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.84.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. - -NOTE: The optional dataframe functionality is available by `cargo install nu --features=dataframe`. - -As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_`. - -# Themes of this release / New features - -## (Major Breaking Change!) `str replace` matches substring by default ([kubouch](https://github.com/nushell/nushell/pull/10038)) - -::: warning Breaking change -See a full overview of the [breaking changes](#breaking-changes) -::: - -`str replace` now matches a substring instead of a regular expression by default and the `-s`/`--string` flag is deprecated (will be removed altogether in 0.85). Matching a substring by default makes it more consistent with the rest of the Nushell's commands. - -> :bulb: **Note!** -> Since `str replace` is a widely used command, many scripts are going to break. Fixing it is easy: -> * If you used `str replace` **without** the `-s`/`--string` flag, you used regex matching and you should add `--regex` flag to keep the previous functionality. -> * If you used `str replace` **with** the `-s`/`--string` flag, you will get a deprecation warning. To get rid of the warning, simply remove the flag. - -## Constants from modules ([WindSoilder](https://github.com/nushell/nushell/pull/9773), [kubouch](https://github.com/nushell/nushell/pull/10049)) - -You can now use constants in modules and export them. Calling `use` on a module will create record containing all module's constants. You can also import the constants directly, for example with `use module.nu const-name`, without creating the module's record. Example: - -```nushell -> module spam { - export const X = 'x' - export module eggs { - export const Y = 'y' - export const viking = 'eats' - } -} - -> use spam - -> $spam -╭──────┬───────────────────╮ -│ eggs │ {record 2 fields} │ -│ X │ x │ -╰──────┴───────────────────╯ - -> $spam.eggs -╭────────┬──────╮ -│ Y │ y │ -│ viking │ eats │ -╰────────┴──────╯ - -> use spam eggs viking - -> $viking -eats -``` - -The exported values are true constants which means that you can use them in some scenarios where you cannot use normal variables, such as: -```nushell -> module files { - export const MY_CONFIG = '/home/viking/.config/nushell/my_config.nu' -} - -> use files MY_CONFIG - -> source $MY_CONFIG # sources '/home/viking/.config/nushell/my_config.nu' -``` - -## New options for more compact table display ([@zhiburt](https://github.com/nushell/nushell/pull/9983), [#9796](https://github.com/nushell/nushell/pull/9796)) - -To save screen space, you can now display tables with the header directly displayed on the border through the `$env.config.table.header_on_separator` option. - -![Table with header displayed on border](../assets/images/0_84_table_compact.png) - -Additionally you can now configure the `padding` left and right of the table cell content either separately or all at once to adjust the layout for your readability needs. - -![Table with different padding options](../assets/images/0_84_table_padding.png) - -## More consistent `format ...` commands ([@sholderbach](https://github.com/nushell/nushell/pull/9788), [@WindSoilder](https://github.com/nushell/nushell/pull/9902)) - -::: warning Breaking change -See a full overview of the [breaking changes](#breaking-changes) -::: - -With this release we moved several commands that serve to produce string output from a particular data type as `format` subcommands. - -1. `date format` has been renamed to `format date` ([#9788](https://github.com/nushell/nushell/pull/9788)). -2. `into duration --convert` was previously used to provide string representations of `duration`s. This option has been removed and you should now use `format duration`. ([#9902](https://github.com/nushell/nushell/pull/9902)) -3. `format filesize` that was previously moved into the `--features extra` set is back in the core ([#9978](https://github.com/nushell/nushell/pull/9978)). - -## `scope` commands enhancements ([kubouch](https://github.com/nushell/nushell/pull/10023), [kubouch](https://github.com/nushell/nushell/pull/10045)) - -`scope` commands received a significant amount of improvements making them more useful for advanced introspection of Nushell's definitions. - -* `scope externs` now lists known externals (defined with `extern`) -* `scope aliases` is now fixed and lists names and usages of the aliases, not of the aliased commands (this used to cause some confusion) -* `scope modules` now lists all the exportable of the module, including submodules with their contents -* all `scope` commands now list the definition's ID which can be used for reliable tracking of definitions. For example, a command `foo` imported from a module `spam` using `use spam` will be named `spam foo`, therefore, relying solely on names of the definitions can sometimes be misleading. -* `module_name` field is no longer present -* `scope variables` now denotes whether a variable is a constant or not - -## `http` commands now handle headers better ([@jflics6460](https://github.com/nushell/nushell/pull/9771), [@ineu](https://github.com/nushell/nushell/pull/10022) - -You can now pass headers directly as a record to the `-H` flag. -```nushell -http get -H {cookie: "acc=foobar"} http://example.com -``` -When running a `http` command with `--full` to get additional metadata about the response you can now get both the request and the reponse header -```nushell -http get --full -H {cooke: "my=cookie"} | get headers | get response -``` - -## Work on the optional dataframe features ([@ayax79](https://github.com/ayax79)) - -[@ayax79](https://github.com/ayax79) has been working hard to update our dataframe command to work again with the stricter type check by consolidating internal logic ([#9860](https://github.com/nushell/nushell/pull/9860), -[#9951](https://github.com/nushell/nushell/pull/9951)). - -Furthermore, `dfr open` now suppports the avro exchange format and a new `dfr to-avro` command was added in [#10019](https://github.com/nushell/nushell/pull/10019) - -## Changes to other commands -Since last release, some commands have changed, here is a list of some interesting changed - -- [@atahabaki](https://github.com/atahabaki) in [#9841](https://github.com/nushell/nushell/pull/9841), [#9856](https://github.com/nushell/nushell/pull/9856) and [#9940](https://github.com/nushell/nushell/pull/9940): Some refinement of the `str expand` command (it's a really cool command, i recommend you check it out :)) -- [@fdncred](https://github.com/fdncred) in [#9987](https://github.com/nushell/nushell/pull/9987): Allow `select` to take a variable with a list of columns -- [@fdncred](https://github.com/fdncred) in [#10048](https://github.com/nushell/nushell/pull/10048): Allow `int` as a *cellpath* for `select` - -## Command organization ([@storm](https://github.com/nushell/nushell/pull/9926), [@jntrnr](https://github.com/nushell/nushell/pull/10051)) - -In our efforts towards stabilization we moved several commands either behind the `--features extra` build-flag or back into the core set of commands. -The special `str *-case` commands for example have been moved out of the core set, while the `bytes` commands to deal with bytes in arbitrary encodings have returned to the core set. -Furthermore all commands in the core set should now have helpful categories associated with them. - -## Deprecation and removal of commands ([@amtoine](https://github.com/nushell/nushell/pull/9840), [@sholderbach](https://github.com/nushell/nushell/pull/10000)) - -We previously used the term "deprecation" pretty loosely to describe the removal of commands while emitting a helpful error. We intend to now start to use deprecation to warn you before the final removal of a particular option or command. -When we removed a command we will now properly refer to it as removal and started adding warnings where appropriate (e.g. `str replace --string`). As part of this update we removed some very old error helpers nudging you to upgrade to new commands. - -## Documentation - -Thanks to [@rgwood](https://github.com/rgwood), [@sholderbach](https://github.com/sholderbach), -[@kubouch](https://github.com/kubouch) and [@fdncred](https://github.com/fdncred) the documentation -has become a bit better in [#9961](https://github.com/nushell/nushell/pull/9961), -[#9996](https://github.com/nushell/nushell/pull/9996), [#10004](https://github.com/nushell/nushell/pull/10004) -and [#10057](https://github.com/nushell/nushell/pull/10057). - -## Notable bugfixes - -- A panic when parsing the context of `let` assignments has been fixed ([@mengsuenyan](https://github.com/mengsuenyan) in [#9851](https://github.com/nushell/nushell/pull/9851)) -- Invoking `--help` on a script with a `def main` command will now report the script's name instead of a more confusing `main` ([@jntrnr](https://github.com/jntrnr) in [#9948](https://github.com/nushell/nushell/pull/9948)) -- Serious bugs in `parse` that produced incorrect output when given a long input stream have been fixed ([@panicbit](https://github.com/panicbit) in [#9925](https://github.com/nushell/nushell/pull/9925), [#9950](https://github.com/nushell/nushell/pull/9950)) - -## Bugfixes - -Thanks to all the contributors who tackled one or more bugs! -| Name | Link | Description | -| ---------------------------------------------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| [@mengsuenyan](https://github.com/mengsuenyan) | [#9853](https://github.com/nushell/nushell/pull/9853) | Fix `~ \| path type` returning empty string | -| [@mengsuenyan](https://github.com/mengsuenyan) | [#9851](https://github.com/nushell/nushell/pull/9851) | Fix the panic when type a statement similar to `let f = 'f' $` in the nushell | -| [@jntrnr](https://github.com/jntrnr) | [#9893](https://github.com/nushell/nushell/pull/9893) | Revert [#9693](https://github.com/nushell/nushell/pull/9693) to prevent CPU hangs | -| [@NotLebedev](https://github.com/NotLebedev) | [#9935](https://github.com/nushell/nushell/pull/9935) | Nothing has the correct return type | -| [@amtoine](https://github.com/amtoine) | [#9947](https://github.com/nushell/nushell/pull/9947) | Force `version` to update when installing with `toolkit.nu` | -| [@amtoine](https://github.com/amtoine) | [#9967](https://github.com/nushell/nushell/pull/9967) | Fix panic with `lines` on an error | -| [@rgwood](https://github.com/rgwood) | [#9990](https://github.com/nushell/nushell/pull/9990) | Fix `watch` not handling all file changes | -| [@nibon7](https://github.com/nibon7) | [#9784](https://github.com/nushell/nushell/pull/9784) | Fix a crash when moving the cursor after accepting a suggestion from the help menu | -| [@meskill](https://github.com/meskill) | [#10007](https://github.com/nushell/nushell/pull/10007) | Fix parser to not update plugin.nu file on nu startup | -| [@zhiburt](https://github.com/zhiburt) | [#10011](https://github.com/nushell/nushell/pull/10011) | nu-table: Fix padding 0 width issues | -| [@3lvir4](https://github.com/3lvir4) | [#10012](https://github.com/nushell/nushell/pull/10012) | Remove potential panic from path join | -| [@kubouch](https://github.com/kubouch) | [#10046](https://github.com/nushell/nushell/pull/10046) | Fix wrong path expansion in `save` | -| [@zhiburt](https://github.com/zhiburt) | [#10050](https://github.com/nushell/nushell/pull/10050) | nu-table: Fix issue with truncation and text border | -| [@jntrnr](https://github.com/jntrnr) | [#10052](https://github.com/nushell/nushell/pull/10052) | Fix default_env.nu after latest changes to `str replace` | -| [@fdncred](https://github.com/fdncred) | [#10067](https://github.com/nushell/nushell/pull/10067) | Allow `return` to return any nushell value | -| [@fdncred](https://github.com/fdncred) | [#10063](https://github.com/nushell/nushell/pull/10063) | Fix `into datetime` to accept more date/time formats | - -And also to those who did tackle purely technical challenges!! -| Name | Link | Description | -| ---------------------------------------------- | ------------------------------------------------------- | -------------------------------------------------------- | -| [@IanManske](https://github.com/IanManske) | [#9909](https://github.com/nushell/nushell/pull/9909) | Enable macOS foreground process handling | -| [@jntrnr](https://github.com/jntrnr) | [#9933](https://github.com/nushell/nushell/pull/9933) | Add tests for script subcommands | -| [@jntrnr](https://github.com/jntrnr) | [#9936](https://github.com/nushell/nushell/pull/9936) | Fix a couple clippy warnings | -| [@IanManske](https://github.com/IanManske) | [#9927](https://github.com/nushell/nushell/pull/9927) | Make `Value::columns` return slice instead of cloned Vec | -| [@jntrnr](https://github.com/jntrnr) | [#9949](https://github.com/nushell/nushell/pull/9949) | Move `help commands` to use more structure in signatures | -| [@fdncred](https://github.com/fdncred) | [#9958](https://github.com/nushell/nushell/pull/9958) | Update `strip-ansi-escapes` to use new api | -| [@rgwood](https://github.com/rgwood) | [#9971](https://github.com/nushell/nushell/pull/9971) | Put heavy dataframe dependencies behind feature flag | -| [@sholderbach](https://github.com/sholderbach) | [#9974](https://github.com/nushell/nushell/pull/9974) | Fixup dataframe build after [#9971](https://github.com/nushell/nushell/pull/9971) | -| [@meskill](https://github.com/meskill) | [#9976](https://github.com/nushell/nushell/pull/9976) | test: Clear parent environment to prevent leakage to tests | -| [@kubouch](https://github.com/kubouch) | [#10036](https://github.com/nushell/nushell/pull/10036) | Add additional span to IncorrectValue error | - - -# Breaking changes -- [#9902](https://github.com/nushell/nushell/pull/9902) `date format` has been renamed to `format date` for consistency. -- [#9788](https://github.com/nushell/nushell/pull/9788) The option `into duration --convert` to format durations has been removed. Use the `format duration` command instead. -- [#10038](https://github.com/nushell/nushell/pull/10038) `str replace` now by default matches to __strings__ by default. If you want to use regexes you need to use the `-r` flag. The `--strings` flag has been removed -- [#9632](https://github.com/nushell/nushell/pull/9632) To be unambiguous the duration type now does not report months or years. The largest unit reported is weeks as they have a consistent length compared to months or years. -- [#9926](https://github.com/nushell/nushell/pull/9926) We moved some of the more exotic `str` case-commands behind the `--features extra` build-flag. This affects: - * `str camel-case` - * `str kebab-case` - * `str pascal-case` - * `str screaming-snake-case` - * `str snake-case` - * `str title-case` -- [#10053](https://github.com/nushell/nushell/pull/10053) make the charpage optional for `std clip` -- [#10023](https://github.com/nushell/nushell/pull/10023) The output of the `scope` commands has changed - -### Internal breaking change only affecting plugin authors -- [#9927](https://github.com/nushell/nushell/pull/9927) Make `Value::columns` return slice instead of cloned Vec - - -# Full changelog -## Nushell -- [amtoine](https://github.com/amtoine) created - - [remove Clippy flags from the PR template](https://github.com/nushell/nushell/pull/10087) - - [Revert "deprecate `--format` and `--list` in `into datetime` (#10017)"](https://github.com/nushell/nushell/pull/10055) - - [make the charpage optional for `std clip`](https://github.com/nushell/nushell/pull/10053) - - [deprecate `--format` and `--list` in `into datetime`](https://github.com/nushell/nushell/pull/10017) - - [fix the signature of `input list`](https://github.com/nushell/nushell/pull/9977) - - [fix the default config for `explore`](https://github.com/nushell/nushell/pull/9962) - - [fix panic with `lines` on an error](https://github.com/nushell/nushell/pull/9967) - - [add a test to make sure "nothing" shows up as "nothing" in help](https://github.com/nushell/nushell/pull/9941) - - [force version to update when installing with toolkit](https://github.com/nushell/nushell/pull/9947) - - [remove old deprecated commands](https://github.com/nushell/nushell/pull/9840) - - [Fix default prompt indicators](https://github.com/nushell/nushell/pull/9914) -- [fdncred](https://github.com/fdncred) created - - [update install/build scripts to include `--locked`](https://github.com/nushell/nushell/pull/10086) - - [allow `help` to return a `Type::Table`](https://github.com/nushell/nushell/pull/10082) - - [try and fix `into datetime` to accept more dt formats](https://github.com/nushell/nushell/pull/10063) - - [allow `return` to return any nushell value](https://github.com/nushell/nushell/pull/10067) - - [enable/update some example tests so they work again](https://github.com/nushell/nushell/pull/10058) - - [try to document the more obscure testbin commands](https://github.com/nushell/nushell/pull/10057) - - [allow int as a cellpath for `select`](https://github.com/nushell/nushell/pull/10048) - - [allow `select` to take a $variable with a list of columns](https://github.com/nushell/nushell/pull/9987) - - [update `strip-ansi-escapes` to 0.2.0 and the latest reedline](https://github.com/nushell/nushell/pull/9970) - - [update `strip-ansi-escapes` to use new api](https://github.com/nushell/nushell/pull/9958) - - [add keybinding for search-history](https://github.com/nushell/nushell/pull/9930) - - [add `header_on_separator` options to default_config.nu](https://github.com/nushell/nushell/pull/9922) - - [updates `let-env` signature to remove required params](https://github.com/nushell/nushell/pull/9917) - - [remove `vectorize_over_list` from python plugin](https://github.com/nushell/nushell/pull/9905) - - [update `format` signature to allow `record` to be passed in](https://github.com/nushell/nushell/pull/9898) - - [update `items` signature to allow `any` output](https://github.com/nushell/nushell/pull/9896) - - [update `char` signature with `Table`](https://github.com/nushell/nushell/pull/9895) - - [update to current reedline](https://github.com/nushell/nushell/pull/9877) - - [bump to dev version 0.83.2](https://github.com/nushell/nushell/pull/9866) -- [jntrnr](https://github.com/jntrnr) created - - [Revert "pin serde to avoid https://github.com/serde-rs/serde/issues/2538"](https://github.com/nushell/nushell/pull/10078) - - [move 'bytes' back to commands](https://github.com/nushell/nushell/pull/10051) - - [pin serde to avoid https://github.com/serde-rs/serde/issues/2538](https://github.com/nushell/nushell/pull/10061) - - [fix default-env after latest changes](https://github.com/nushell/nushell/pull/10052) - - [Rename `main` to script name when running scripts](https://github.com/nushell/nushell/pull/9948) - - [Auto-expand table based on terminal width](https://github.com/nushell/nushell/pull/9934) - - [fix the Cargo.lock file](https://github.com/nushell/nushell/pull/9955) - - [Move `help commands` to use more structure in signatures](https://github.com/nushell/nushell/pull/9949) - - [Fix a couple clippy warnings](https://github.com/nushell/nushell/pull/9936) - - [Add tests for script subcommands](https://github.com/nushell/nushell/pull/9933) - - [Revert "Add an option to move header on borders"](https://github.com/nushell/nushell/pull/9908) - - [Re-align how prompt indicators work](https://github.com/nushell/nushell/pull/9907) - - [Simplify default style and match Rust code to config](https://github.com/nushell/nushell/pull/9900) - - [Revert 9693 to prevent CPU hangs](https://github.com/nushell/nushell/pull/9893) -- [sholderbach](https://github.com/sholderbach) created - - [Polish `CONTRIBUTING`, add Rust style](https://github.com/nushell/nushell/pull/10071) - - [Remove global clippy `-A` from `toolkit.nu`](https://github.com/nushell/nushell/pull/10073) - - [Remove clippy global `-A` from CI](https://github.com/nushell/nushell/pull/10072) - - [Pin reedline to 0.23.0](https://github.com/nushell/nushell/pull/10070) - - [Rename misused "deprecation" to removal](https://github.com/nushell/nushell/pull/10000) - - [Improve I/O types of `into decimal`(/float)](https://github.com/nushell/nushell/pull/9998) - - [Add search terms to `reject`](https://github.com/nushell/nushell/pull/9996) - - [Move `format duration`/`filesize` back into core](https://github.com/nushell/nushell/pull/9978) - - [Fixup dataframe build after #9971](https://github.com/nushell/nushell/pull/9974) - - [Add `format duration` to replace `into duration --convert`](https://github.com/nushell/nushell/pull/9788) - - [Update `unicode-linebreak` to `0.1.5`](https://github.com/nushell/nushell/pull/9814) -- [kubouch](https://github.com/kubouch) created - - [Remove "let config" warning](https://github.com/nushell/nushell/pull/10068) - - [ Simplify virtualenv testing](https://github.com/nushell/nushell/pull/10035) - - [Recursively export constants from modules](https://github.com/nushell/nushell/pull/10049) - - [Add a few more fields to `scope` commands](https://github.com/nushell/nushell/pull/10045) - - [Add additional span to IncorrectValue error](https://github.com/nushell/nushell/pull/10036) - - [Allow exporting extern-wrapped](https://github.com/nushell/nushell/pull/10025) - - [Fix wrong path expansion in `save`](https://github.com/nushell/nushell/pull/10046) - - [Change `str replace` to match substring by default](https://github.com/nushell/nushell/pull/10038) - - [Remove dead code from tests](https://github.com/nushell/nushell/pull/10040) - - [Sort entries in `scope` commands; Fix usage of externs](https://github.com/nushell/nushell/pull/10039) - - [Refactor `scope` commands](https://github.com/nushell/nushell/pull/10023) - - [Fix example for `extern-wrapped`](https://github.com/nushell/nushell/pull/10004) -- [zhiburt](https://github.com/zhiburt) created - - [nu-table: fix issue with truncation and text border](https://github.com/nushell/nushell/pull/10050) - - [nu-table: Fix padding 0 width issues](https://github.com/nushell/nushell/pull/10011) - - [nu-table/ Add `table.padding` configuration](https://github.com/nushell/nushell/pull/9983) - - [Add an option to set header on border (style)](https://github.com/nushell/nushell/pull/9920) - - [Add an option to move header on borders](https://github.com/nushell/nushell/pull/9796) -- [sitiom](https://github.com/sitiom) created - - [Change Winget Releaser job to `ubuntu-latest`](https://github.com/nushell/nushell/pull/10032) -- [ineu](https://github.com/ineu) created - - [Make `http -f` display the request headers. Closes #9912](https://github.com/nushell/nushell/pull/10022) -- [3lvir4](https://github.com/3lvir4) created - - [Remove potential panic from path join](https://github.com/nushell/nushell/pull/10012) -- [ayax79](https://github.com/ayax79) created - - [Expose polars avro support](https://github.com/nushell/nushell/pull/10019) - - [Nushell table list columns -> dataframe list columns. Explode / Flatten dataframe support.](https://github.com/nushell/nushell/pull/9951) - - [Merged overloaded commands](https://github.com/nushell/nushell/pull/9860) -- [app/dependabot](https://github.com/app/dependabot) created - - [Bump quick-xml from 0.29.0 to 0.30.0](https://github.com/nushell/nushell/pull/9870) - - [Bump rstest from 0.17.0 to 0.18.1](https://github.com/nushell/nushell/pull/9782) -- [meskill](https://github.com/meskill) created - - [fix(nu-parser): do not update plugin.nu file on nu startup](https://github.com/nushell/nushell/pull/10007) - - [test: clear parent envs to prevent leakage to tests](https://github.com/nushell/nushell/pull/9976) -- [nibon7](https://github.com/nibon7) created - - [Fix a crash when moving the cursor after accepting a suggestion from the help menu](https://github.com/nushell/nushell/pull/9784) -- [rgwood](https://github.com/rgwood) created - - [Fix `watch` not handling all file changes](https://github.com/nushell/nushell/pull/9990) - - [Put heavy dataframe dependencies behind feature flag](https://github.com/nushell/nushell/pull/9971) - - [Fix cross-compiling with cross-rs](https://github.com/nushell/nushell/pull/9972) - - [Fix `match` example whitespace](https://github.com/nushell/nushell/pull/9961) -- [panicbit](https://github.com/panicbit) created - - [parse: collect external stream chunks before matching](https://github.com/nushell/nushell/pull/9950) - - [do not emit None mid-stream during parse](https://github.com/nushell/nushell/pull/9925) -- [bobhy](https://github.com/bobhy) created - - [Fix duration type to not report months or years](https://github.com/nushell/nushell/pull/9632) -- [IanManske](https://github.com/IanManske) created - - [Make `Value::columns` return slice instead of cloned Vec](https://github.com/nushell/nushell/pull/9927) - - [Enable macOS foreground process handling](https://github.com/nushell/nushell/pull/9909) - - [Replace `&Span` with `Span` since `Span` is `Copy`](https://github.com/nushell/nushell/pull/9770) -- [atahabaki](https://github.com/atahabaki) created - - [str-expand: update bracoxide to v0.1.2, fixes #9913](https://github.com/nushell/nushell/pull/9940) - - [str-expand: add path flag](https://github.com/nushell/nushell/pull/9856) - - [str-expand: Add Escaping Example](https://github.com/nushell/nushell/pull/9841) -- [stormasm](https://github.com/stormasm) created - - [Categorification: move commands histogram and version out of the default category](https://github.com/nushell/nushell/pull/9946) - - [Categorification: move from Default category to Filters](https://github.com/nushell/nushell/pull/9945) - - [Categorification: move Path commands out of the default category](https://github.com/nushell/nushell/pull/9937) - - [Categorification: graduate nuon --- from the experimental category to the formats category](https://github.com/nushell/nushell/pull/9932) - - [Categorification: move uncategorized String commands to Category::Strings](https://github.com/nushell/nushell/pull/9931) - - [Cratification: move some str case commands to nu-cmd-extra](https://github.com/nushell/nushell/pull/9926) -- [NotLebedev](https://github.com/NotLebedev) created - - [Nothing return type](https://github.com/nushell/nushell/pull/9935) -- [WindSoilder](https://github.com/WindSoilder) created - - [rename from `date format` to `format date`](https://github.com/nushell/nushell/pull/9902) - - [Module: support defining const and use const variables inside of function](https://github.com/nushell/nushell/pull/9773) -- [mengsuenyan](https://github.com/mengsuenyan) created - - [Fixed the panic when type a statement similar to `let f = 'f' $` in the nushell](https://github.com/nushell/nushell/pull/9851) - - [fixed the bug `~ | path type` return empty string](https://github.com/nushell/nushell/pull/9853) -- [app/](https://github.com/app/) created - - [Turn bare URLs into cliclable links](https://github.com/nushell/nushell/pull/9854) -- [jflics6460](https://github.com/jflics6460) created - - [Accept records for http subcommand headers (-H)](https://github.com/nushell/nushell/pull/9771) - -## Extension -- [balupton](https://github.com/balupton) created - - [readmde: close #148 - link extension page](https://github.com/nushell/vscode-nushell-lang/pull/149) - -## Documentation -- [jwarlander](https://github.com/jwarlander) created - - [Use '--locked' in cargo install snippet for dataframe feature](https://github.com/nushell/nushell.github.io/pull/1010) -- [hustcer](https://github.com/hustcer) created - - [Update table mode config doc, fix #1007](https://github.com/nushell/nushell.github.io/pull/1008) - - [Finish `let-env` removal in Chinese translation](https://github.com/nushell/nushell.github.io/pull/1005) - - [Upgrade some dependencies, and fix some broken assets import](https://github.com/nushell/nushell.github.io/pull/995) -- [conqp](https://github.com/conqp) created - - [Update command to list aliases](https://github.com/nushell/nushell.github.io/pull/1006) -- [sholderbach](https://github.com/sholderbach) created - - [Finish `let-env` removal in German translation](https://github.com/nushell/nushell.github.io/pull/1004) -- [amtoine](https://github.com/amtoine) created - - [remove last mentions to `let-env`](https://github.com/nushell/nushell.github.io/pull/999) - - [patch: release notes for 0.83.1](https://github.com/nushell/nushell.github.io/pull/994) -- [BrewingWeasel](https://github.com/BrewingWeasel) created - - [Remove unused empty column](https://github.com/nushell/nushell.github.io/pull/1003) -- [rgwood](https://github.com/rgwood) created - - [Cookbook cleanup](https://github.com/nushell/nushell.github.io/pull/1001) -- [oatovar](https://github.com/oatovar) created - - [Update testing examples](https://github.com/nushell/nushell.github.io/pull/997) -- [rprtr258](https://github.com/rprtr258) created - - [Update explore.md](https://github.com/nushell/nushell.github.io/pull/1000) -- [LeoniePhiline](https://github.com/LeoniePhiline) created - - [fix(docs): Fix link to "setting environment variables"](https://github.com/nushell/nushell.github.io/pull/996) - - [fix(docs): Link to Command Reference led to HTTP 404](https://github.com/nushell/nushell.github.io/pull/993) - -## Nu_Scripts -- [fdncred](https://github.com/fdncred) created - - [fix the other place in the weather script](https://github.com/nushell/nu_scripts/pull/581) - - [fix weather duration after latest nushell changes](https://github.com/nushell/nu_scripts/pull/580) - - [update prompts scripts with new `str replace` syntax](https://github.com/nushell/nu_scripts/pull/579) - - [update `date format` to `format date` in oh-my.nu](https://github.com/nushell/nu_scripts/pull/570) - - [delete codeowners file](https://github.com/nushell/nu_scripts/pull/568) -- [WindSoilder](https://github.com/WindSoilder) created - - [Update python-venv.nu so we can enter subdirectory without an error](https://github.com/nushell/nu_scripts/pull/574) -- [Neur1n](https://github.com/Neur1n) created - - [minor changes to nu_conda.nu and nu_msvs.nu](https://github.com/nushell/nu_scripts/pull/576) -- [EmilySeville7cfg](https://github.com/EmilySeville7cfg) created - - [Simple json schema generator](https://github.com/nushell/nu_scripts/pull/577) -- [uroybd](https://github.com/uroybd) created - - [feat(completions): Ô£¿ add PDM custom completions](https://github.com/nushell/nu_scripts/pull/573) -- [amtoine](https://github.com/amtoine) created - - [rename `date format` to `format date`](https://github.com/nushell/nu_scripts/pull/571) - - [fix the date schedule in the release scripts](https://github.com/nushell/nu_scripts/pull/561) -- [e2dk4r](https://github.com/e2dk4r) created - - [custom-completions: scoop: fix getting environmental variables](https://github.com/nushell/nu_scripts/pull/567) - -## Reedline -- [sholderbach](https://github.com/sholderbach) created - - [Bump version for 0.23 release](https://github.com/nushell/reedline/pull/626) -- [fdncred](https://github.com/fdncred) created - - [update to strip-ansi-escapes 0.2.0](https://github.com/nushell/reedline/pull/618) - - [update `strip-ansi-escapes` to their latest api](https://github.com/nushell/reedline/pull/617) - - [turn off default prompt styling (bold) to prevent leakage](https://github.com/nushell/reedline/pull/615) diff --git a/blog/2023-09-19-nushell_0_85_0.md b/blog/2023-09-19-nushell_0_85_0.md deleted file mode 100644 index 20c373cd938..00000000000 --- a/blog/2023-09-19-nushell_0_85_0.md +++ /dev/null @@ -1,595 +0,0 @@ ---- -title: Nushell 0.85 -author: The Nu Authors -author_site: https://twitter.com/nu_shell -author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.85 of Nu. This release adds the first uutils command, unlocks more constant evaluation at parse time, and polishes many commands. ---- - -# Nushell 0.85 -Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. - -Today, we're releasing version 0.85 of Nu. This release adds the first uutils command, unlocks more constant evaluation at parse time, and polishes many commands. - - - -# Where to get it -Nu 0.85 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.85.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. - -NOTE: The optional dataframe functionality is available by `cargo install nu --features=dataframe`. - -As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_`. - -# Themes of this release / New features -## Nushell + Uutils = ❤️ -📢The Nushell team is thrilled to announce 🥳 that we've begun working with the [`uutils/coreutils` team on integrating some of their foundational core utilies into nushell](https://www.nushell.sh/blog/2023-09-05-why-uu.html). With this release, we've started with the coreutils `cp` command, which we've temporarily named `ucp`. We're starting with `ucp` to allow broad testing while the current nushell `cp` command remains the default. We've already found one [bug](https://github.com/uutils/coreutils/issues/5257) in the coreutils `cp` command and you might find others. Once it stabelizes, probably with the 0.86.0 release, we'll remove the nushell `cp` command and rename `ucp` to `cp`. In keeping with the nushell style, we've only added a handful of parameters. We can, and probably will, add more if the community determines we need them. We're so very excited and would like to thank [terts](https://github.com/tertsdiepraam), from the coreutils team, for his excellent help and special appreciation to [dmatos2012](https://github.com/dmatos2012) for the, very iterative, first `uutils/coreutils` integration PR [#10097](https://github.com/nushell/nushell/pull/10097) for the `cp` command. To read more about how this came to be, checkout [our blog post](https://www.nushell.sh/blog/2023-09-05-why-uu.html). - -## Quite a few bug fixes -Thanks to all the contributors below for helping us solve issues and bugs :pray: -| author | description | url | -| ------------------------------------------------ | --------------------------------------------------------------------------------- | ------------------------------------------------------- | -| [@rgwood](https://github.com/rgwood) | Fix watch not detecting modifications on Windows | [#10109](https://github.com/nushell/nushell/pull/10109) | -| [@ito-hiroki](https://github.com/ito-hiroki) | Fix tab completion order of directories to consistent with order of files | [#10102](https://github.com/nushell/nushell/pull/10102) | -| [@herobs](https://github.com/herobs) | Fix 9156 endian consistency | [#9873](https://github.com/nushell/nushell/pull/9873) | -| [@ayax79](https://github.com/ayax79) | fixed usages of deprecated chrono DateTime::from_utc | [#10161](https://github.com/nushell/nushell/pull/10161) | -| [@zhiburt](https://github.com/zhiburt) | Fix #10154 | [#10162](https://github.com/nushell/nushell/pull/10162) | -| [@ofek](https://github.com/ofek) | Fix example history command pipeline | [#10220](https://github.com/nushell/nushell/pull/10220) | -| [@dead10ck](https://github.com/dead10ck) | Fix unit tests on Android | [#10224](https://github.com/nushell/nushell/pull/10224) | -| [@amtoine](https://github.com/amtoine) | fix default after an empty where | [#10240](https://github.com/nushell/nushell/pull/10240) | -| [@IanManske](https://github.com/IanManske) | Fix `rm` on macOS | [#10282](https://github.com/nushell/nushell/pull/10282) | -| [@horasal](https://github.com/horasal) | handle empty pipeline while parsing let (fix Issue10083) | [#10116](https://github.com/nushell/nushell/pull/10116) | -| [@dmatos2012](https://github.com/dmatos2012) | Fix variables not allowed in ucp | [#10304](https://github.com/nushell/nushell/pull/10304) | -| [@sholderbach](https://github.com/sholderbach) | Update `crates-ci/typos` and fix new typos | [#10313](https://github.com/nushell/nushell/pull/10313) | -| [@GomesGoncalo](https://github.com/GomesGoncalo) | fix #10319: allow json request of value type list | [#10356](https://github.com/nushell/nushell/pull/10356) | -| [@jntrnr](https://github.com/jntrnr) | fix 'let' to properly redirect | [#10360](https://github.com/nushell/nushell/pull/10360) | -| [@amtoine](https://github.com/amtoine) | fix the pretty printing of failing tests in std | [#10373](https://github.com/nushell/nushell/pull/10373) | -| [@J-Kappes](https://github.com/J-Kappes) | fix input --until-bytes: now stops at any of given bytes | [#10235](https://github.com/nushell/nushell/pull/10235) | -| [@zhiburt](https://github.com/zhiburt) | nu-table: Fix expand table unnessary color in trail head config when wrap is used | [#10367](https://github.com/nushell/nushell/pull/10367) | -| [@fdncred](https://github.com/fdncred) | fix some new chrono warnings | [#10384](https://github.com/nushell/nushell/pull/10384) | -| [@horasal](https://github.com/horasal) | prevent crash when use redirection with let/mut | [#10139](https://github.com/nushell/nushell/pull/10139) | -| [@horasal](https://github.com/horasal) | Allow operator in constants | [#10212](https://github.com/nushell/nushell/pull/10212) | -| [@zhiburt](https://github.com/zhiburt) | nu-table: Patch restore lead trail space bg color | [#10351](https://github.com/nushell/nushell/pull/10351) | -| [@zhiburt](https://github.com/zhiburt) | nu-table: Strip custom color in the header when used on border | [#10357](https://github.com/nushell/nushell/pull/10357) | - -## Consistent use of `float` for our floating point type - -::: warning Breaking change -See a full overview of the [breaking changes](#breaking-changes) -::: - -Nushell currently supports two types to represent numbers without units: `int` for integer numbers and `float` for floating point numbers. -The latter type was in important places incorrectly referred to as `decimal`. This hid the fact that as floating point numbers they have limited precision in some circumstances but higher performance compared to a decimal-encoded number. - -With this release we fix this inaccuracy. - -This means we introduce the commands `into float` and `random float` and deprecate the commands `into decimal` and `random decimal`. The old commands will be removed with the next release but continue to work for this release with a warning. -Please use `into float` instead of `into decimal` and `random float` instead of `random decimal`. - -After the type returned by `describe` has been `float` for a while, we now also change which type name is allowed when specifying command argument or input/output types. - -```nu -# Argument with a specfic type -def foo [bar: float] {} -# Command taking only floating point input from the pipeline and returning the same type. -def baz [] float->float {} -``` -Previously both `float` and `decimal` were supported in those positions. - -## Some updates on `explore` - -::: warning Breaking change -See a full overview of the [breaking changes](#breaking-changes) -::: - -The `explore` built-in commands have changed a bit during this release. - -Now, it supports Vim bindings out of the box thanks to [@amtoine](https://github.com/amtoine) in -[#9966](https://github.com/nushell/nushell/pull/9966). -[@rgwood](https://github.com/rgwood) has simplified the available configuration entries which used -to make the command less easy to understand in -[#10258](https://github.com/nushell/nushell/pull/10258) -[#10259](https://github.com/nushell/nushell/pull/10259) and -[#10270](https://github.com/nushell/nushell/pull/10270). - -Thanks to him again, one can now quit the `explore`r by hitting any of `ctrl+c`, `ctrl+d` or -`ctrl+q` (see [#10257](https://github.com/nushell/nushell/pull/10257)). - -## Improvements to parse-time evaluation - -_Conditional `source` and `use` is now possible._ - -The Nushell core team has been asked quite a lot of times to be able to do parse-time conditional -`source`ing or `use`ing in the configuration, e.g. to load different things depending on the system: -```nushell -if $nu.os-info.name == "windows" { - source "my_windows_config.nu" -} else { - source "my_unix_config.nu" -} -``` - -The above snippet does not work because Nushell's scoping rules keep the sourced values inside the block and the sourcing would not have any visible effect outside of the if/else statement (except environment changes). - -While scoping still works the same, a series of PRs by [@kubouch](https://github.com/kubouch) made conditional `source`/`use`/`overlay use` possible: -- [#9499](https://github.com/nushell/nushell/pull/9499), allows parse-time evaluation of commands, pipelines and subexpressions (see also [Looking for help!](#looking-for-help)) -- with [#10326](https://github.com/nushell/nushell/pull/10326), `if` can now be evaluated at parse time -- finally, [#10160](https://github.com/nushell/nushell/pull/10160) makes the `$nu` built-in variable a true constant :partying_face: - -What does this all mean? One can now write something very similar to the proposed snippet -above! For example: -```nushell -const WINDOWS_CONFIG = "my_windows_config.nu" -const UNIX_CONFIG = "my_unix_config.nu" - -const ACTUAL_CONFIG = if $nu.os-info.name == "windows" { - $WINDOWS_CONFIG -} else { - $UNIX_CONFIG -} - -source $ACTUAL_CONFIG -``` - -### Looking for help! - -[#9499](https://github.com/nushell/nushell/pull/9499) allows running selected commands at parse time. For example, -```nushell -const f = ($nu.default-config-dir | path dirname) -``` -is possible because `path dirname` was manually ported to allow parse time evaluation. Only a very limited subset of Nushell's commands is currently allowed to do so: -* `str length` -* `path` commands -* Some core commands: `describe`, `ignore`, `version`, `if` - -We would like to expand this set to allow more commands to run at parse time. If you'd like to help us porting more commands, we'd welcome your help! Please, see [#10239](https://github.com/nushell/nushell/issues/10239) for more information. Porting the commands is not difficult, but requires a bit of consideration, so it's better to reply to the issue or reach out to the core team beforehand. - -## Improving accessibility -Up until now, an issue for users using a screen reader was that Nushell errors and tables are quite -fancy with some unicode characters. -The issue is that screen reader might have trouble reading them, making the understanding of what's -going on the REPL very hard... - -For tables, it's quite easy, you can set `$env.config.table.mode` to something like `"basic"` or -`"none"` and you should be good! -But errors remained fancy -```nushell -Error: nu::shell::external_command - - × External command failed - ╭─[entry #4:1:1] - 1 │ foo - · ─┬─ - · ╰── did you mean 'for'? - ╰──── - help: No such file or directory (os error 2) -``` - -[@JoaquinTrinanes](https://github.com/JoaquinTrinanes) did implement screen reader-friendly errors -in [#10122](https://github.com/nushell/nushell/pull/10122) which will hopefully make the experience -a lot better when it comes to errors. - -## More support for more platforms -In this release, [@dead10ck](https://github.com/dead10ck) made it possible to use Nushell in Termux -([#10013](https://github.com/nushell/nushell/pull/10013)) and fixed a bug on Android -([#10225](https://github.com/nushell/nushell/pull/10225)). - -## Improved history isolation -::: warning Breaking change -See a full overview of the [breaking changes](#breaking-changes) -::: - -Like many other shells, history between open sessions can be isolated in nushell. -However, the former implementation had the disadvantage that it also blocked access to history of former sessions. -It also didn't isolate hints. -This is now fixed with [!10402](https://github.com/nushell/nushell/pull/10402) by [@Hofer-Julian](https://github.com/Hofer-Julian). -Since this was merged shortly before the release, this feature isn't the default yet. -The `file_format` has to be changed to `"sqlite"` and `isolation` has to be set to `true`. -You can find those in the [config file](https://github.com/nushell/nushell/blob/39d93b536a02c95c263925a47b9e4c34587ce021/crates/nu-utils/src/sample_config/default_config.nu#L202) under `$nu.config-path`. -Please test this so we can fix problems before history isolation becomes the default. - -## Enhancing the documentation -Thanks to all the contributors below for helping us making the documentation of Nushell commands better :pray: -| author | description | url | -| ------------- | ------------------------------------------------------------- | ------------------------------------------------------- | -| @Hofer-Julian | Add notice to enable develop mode on Windows | [#10111](https://github.com/nushell/nushell/pull/10111) | -| @fdncred | update query web example because wikipedia changed their page | [#10173](https://github.com/nushell/nushell/pull/10173) | -| @alsuren | Point from keybindings help to the book's reedline chapter | [#10193](https://github.com/nushell/nushell/pull/10193) | -| @sholderbach | Document that `open` looks up `from` subcommands | [#10255](https://github.com/nushell/nushell/pull/10255) | -| @balupton | readme: add dorothy to supported by | [#10262](https://github.com/nushell/nushell/pull/10262) | -| @brunerm99 | feat: Search terms for use, while, and range (#5093) | [#10265](https://github.com/nushell/nushell/pull/10265) | -| @amtoine | add case-insensitive example to `where` | [#10299](https://github.com/nushell/nushell/pull/10299) | - -## Help with tests -Some more technical work but very helpful to make the source code of Nushell better, so thanks to our -contributors who did improve the tests, often going through the whole source base and doing tideous -find and replace :pray: -| author | description | url | -| ------------ | --------------------------------------------- | ------------------------------------------------------- | -| @J-Kappes | Tests: clean up unnecessary use of pipeline() | [#10170](https://github.com/nushell/nushell/pull/10170) | -| @sholderbach | Remove dead tests depending on `inc` | [#10179](https://github.com/nushell/nushell/pull/10179) | -| @sholderbach | Simplify rawstrings in tests | [#10180](https://github.com/nushell/nushell/pull/10180) | - -## Changes to commands -As usual, new release rhyms with changes to commands! -- a bunch of new columns have been added to the `ps` commands: - - [@fdncred](https://github.com/fdncred) in [#10275](https://github.com/nushell/nushell/pull/10275) - and [#10344](https://github.com/nushell/nushell/pull/10344) - - [@WindSoilder](https://github.com/WindSoilder) in - [#10347](https://github.com/nushell/nushell/pull/10347) -- [@nanoqsh](https://github.com/nanoqsh) has made the behaviour of `append` and `prepend` consistent - regarding ranges in [#10231](https://github.com/nushell/nushell/pull/10231) -- [@Tiggax](https://github.com/Tiggax) has started working on making `select`, `get` and `reject` - more consistent in [#10163](https://github.com/nushell/nushell/pull/10163) and - [#10216](https://github.com/nushell/nushell/pull/10216) -- **Breaking change:** `math` constants have been moved from built-in commands to *true* constants in - the standard library by [@amtoine](https://github.com/amtoine) in - [#9678](https://github.com/nushell/nushell/pull/9678) -- the `into duration` command now accepts integers as arguments and the unit can be specified via an - option with the changes introduced by [@amtoine](https://github.com/amtoine) in - [#10286](https://github.com/nushell/nushell/pull/10286) -- thanks to [@fdncred](https://github.com/fdncred) in - [#10354](https://github.com/nushell/nushell/pull/10354), the `commandline` command can now move - you to the end of the line, no need to "move 1000 characters to the right" anymore - -## Some table themes -Want more delight? [@fdncred](https://github.com/fdncred) got you covered. -He added a bunch of new table themes / modes in -[#10279](https://github.com/nushell/nushell/pull/10279). - -## `echo` is evolving -Coming from other shells, e.g. POSIX ones like Bash or Zsh, the distinction between Nushell's `echo` -and `print` commands and the behaviour of `echo` itself could be confusing :thinking: - -- `print` is a more programming-language-friendly command: it does print its arguments to the - terminal directly, consuming them and thus not allowing to pipe the "output" of print further. -- `echo` was only used to create values and pass them down a pipeline, e.g. `echo "foo" | str length` - -[@jntrnr](https://github.com/jntrnr) made the behaviour of `echo` a bit more general -- it will print to the terminal if not redirected -- it will pass the value down to the pipeline if redirected - -```nushell -echo "foo" # will behave exactly as `print` does -echo "foo" | str length # will compute the length of `"foo"` and forward the result without - # "printing" it unless it's the last command being run -``` - -## Pythonesque operators removal - -::: warning Breaking change -See a full overview of the [breaking changes](#breaking-changes) -::: - -Coming from Python, things like -```python -3 * "foo" -[1, 2] * 10 -``` -would probably appear familiar. - -However, they could lead to some strange internal behaviours and hard to debug issues :confused: -```nushell -> [3, "bob", 4] | reduce --fold 1 {|x, y| $x * $y} -bobbobbobbobbobbobbobbobbobbobbobbob -``` - -> **Note** -> in the example above, we are mixing integer and string multiplication, which might get weird! - -In this release, we decided to remove the string and list scalar multiplication in -[#10292](https://github.com/nushell/nushell/pull/10292) and -[#10293](https://github.com/nushell/nushell/pull/10293) from [@sholderbach](https://github.com/sholderbach). - -However, we do not want to leave you without any other way to achieve the same, this is why -[@amtoine](https://github.com/amtoine) did implement the `repeat` command in the standard library -in [#10339](https://github.com/nushell/nushell/pull/10339) -- bring it into your scope with `use std repeat` -- you can do scalar string multiplication with something like `"foo" | repeat 3 | str join` -- you can do scalar list multiplication with something like `[1, 2] | repeat 3 | flatten` - -## Optimizations -[#10378](https://github.com/nushell/nushell/pull/10378) Switched the default allocator to `mimalloc` as it's shown to reduce startup time by upwards of 30% on Windows. If it does not build on unique platforms nushell can be built without this feature, then using the platform's default allocator. - -# New commands -- [`into float`](https://github.com/nushell/nushell/pull/9979) as a replacement for `into decimal` -- [`random float`](https://github.com/nushell/nushell/pull/10320) as a replacement for `random decimal` - -In the standard library we added the following commands: -- [`std repeat`](https://github.com/nushell/nushell/pull/10339) as a command to repeat an element `n` times in a list. -- [`std formats from ndjson`](https://github.com/nushell/nushell/pull/10283) as a way to directly open newline-delimited JSON recrods. You can use `open` for files with the `.ndjson` ending if you `use std formats "from ndjson"`. -- [`std formats from jsonl`](https://github.com/nushell/nushell/pull/10283) as a way to directly open newline-delimited JSON records. You can use `open` for files with the `.jsonl` ending if you `use std formats "from jsonl"`. - -# Deprecations -## Deprecated commands -- [`into decimal`](https://github.com/nushell/nushell/pull/9979): Use `into float` instead -- [`random decimal`](https://github.com/nushell/nushell/pull/10320): Use `random float` instead - -# Breaking changes -* Plugin authors need to update plugins after the span refactor -* Updated plugins need to be recompiled -- [#10235](https://github.com/nushell/nushell/pull/10235) `input --until-bytes` now stops at any of given bytes -- [#10333](https://github.com/nushell/nushell/pull/10333) Consistently use `float` instead of `decimal` in type specifications -- [#10293](https://github.com/nushell/nushell/pull/10293) Remove pythonic `string * list` multiplication -- [#10292](https://github.com/nushell/nushell/pull/10292) Remove pythonic `int * list` multiplication -- [#10338](https://github.com/nushell/nushell/pull/10338) Change `echo` to print when not redirected -- [#10259](https://github.com/nushell/nushell/pull/10259) explore: remove `:config`, `:show-config`, `:tweak` commands -- [#9929](https://github.com/nushell/nushell/pull/9929) Rename the types with spaces in them to use `-` -- [#10254](https://github.com/nushell/nushell/pull/10254) Change LOG_FORMAT to NU_LOG_FORMAT in nu-std library -- [#9678](https://github.com/nushell/nushell/pull/9678) Move math constants to standard library -- [#10231](https://github.com/nushell/nushell/pull/10231) Make `append`/`prepend` consistent for ranges -- [#9966](https://github.com/nushell/nushell/pull/9966) Add support for Vim motions in `explore` -- [#10042](https://github.com/nushell/nushell/pull/10042) Spanned Value step 1: span all value cases -- [#10103](https://github.com/nushell/nushell/pull/10103) Create `Record` type -- [#10064](https://github.com/nushell/nushell/pull/10064) Fully remove `str replace --string` option after deprecation. Just use `str replace` instead. - -# Full changelog -## Nushell -- [tokatoka](https://github.com/tokatoka) created - - [Add 2 fuzzers for nu-path, nu-parser](https://github.com/nushell/nushell/pull/10376) -- [sholderbach](https://github.com/sholderbach) created - - [Clippy in tests](https://github.com/nushell/nushell/pull/10394) - - [Update internal use of `decimal` to `float`](https://github.com/nushell/nushell/pull/10333) - - [Optimize use of range in `std repeat`](https://github.com/nushell/nushell/pull/10353) - - [Remove python-like string multiplication](https://github.com/nushell/nushell/pull/10293) - - [Invert `&Option`s to `Option<&T>`](https://github.com/nushell/nushell/pull/10315) - - [Remove pythonic `int * list` behavior](https://github.com/nushell/nushell/pull/10292) - - [Rename `random decimal` to `random float`](https://github.com/nushell/nushell/pull/10320) - - [Rename `into decimal` to `into float`](https://github.com/nushell/nushell/pull/9979) - - [Deref `&String` arguments to `&str` where appropriate](https://github.com/nushell/nushell/pull/10321) - - [Use slices directly instead of `&Vec`](https://github.com/nushell/nushell/pull/10328) - - [Bump `calamine` and fix clippy](https://github.com/nushell/nushell/pull/10314) - - [Update `crates-ci/typos` and fix new typos](https://github.com/nushell/nushell/pull/10313) - - [Remove `Cargo.lock` in subcrates](https://github.com/nushell/nushell/pull/10280) - - [Move spellcheck config into `.github` folder](https://github.com/nushell/nushell/pull/10267) - - [Remove codecov.io setup](https://github.com/nushell/nushell/pull/10266) - - [Document that `open` looks up `from` subcommands](https://github.com/nushell/nushell/pull/10255) - - [Tweak contributor image to include more users](https://github.com/nushell/nushell/pull/10238) - - [Update `crossterm`/`ratatui`/dev-`reedline`](https://github.com/nushell/nushell/pull/10137) - - [Simplify rawstrings in tests](https://github.com/nushell/nushell/pull/10180) - - [Remove dead tests depending on `inc`](https://github.com/nushell/nushell/pull/10179) - - [Keep `arrow2` out of basic `--workspace` build](https://github.com/nushell/nushell/pull/10178) -- [fdncred](https://github.com/fdncred) created - - [fix some new chrono warnings](https://github.com/nushell/nushell/pull/10384) - - [add helper switch to move cursor to end of buffer](https://github.com/nushell/nushell/pull/10354) - - [add a few more columns to linux `ps -l` output](https://github.com/nushell/nushell/pull/10344) - - [silence some ucp warnings](https://github.com/nushell/nushell/pull/10294) - - [allow update to use metadata](https://github.com/nushell/nushell/pull/10264) - - [add 6 more table themes](https://github.com/nushell/nushell/pull/10279) - - [respect a users locale with the right prompt](https://github.com/nushell/nushell/pull/10273) - - [add more `ps` columns in Windows](https://github.com/nushell/nushell/pull/10275) - - [update format date when using %x %X %r](https://github.com/nushell/nushell/pull/10272) - - [Restore NU_LIB_DIRS and NU_PLUGIN_DIRS defaults](https://github.com/nushell/nushell/pull/10252) - - [allow `--login` to be used with nu's `--commands` parameter](https://github.com/nushell/nushell/pull/10253) - - [add plugin path when there are no signatures](https://github.com/nushell/nushell/pull/10201) - - [update query web example because wikipedia changed their page](https://github.com/nushell/nushell/pull/10173) - - [name hooks internally](https://github.com/nushell/nushell/pull/10127) - - [bump rust-toolchain to 1.70.0](https://github.com/nushell/nushell/pull/10113) -- [FilipAndersson245](https://github.com/FilipAndersson245) created - - [Adds mimalloc as default feature.](https://github.com/nushell/nushell/pull/10378) -- [zhiburt](https://github.com/zhiburt) created - - [nu-table: Fix expand table unnessary color in trail head config when wrap is used](https://github.com/nushell/nushell/pull/10367) - - [nu-table: Strip custom color in the header when used on border](https://github.com/nushell/nushell/pull/10357) - - [nu-table: Patch restore lead trail space bg color](https://github.com/nushell/nushell/pull/10351) - - [nu-explore: Refactorings](https://github.com/nushell/nushell/pull/10247) - - [Fix #10154](https://github.com/nushell/nushell/pull/10162) -- [J-Kappes](https://github.com/J-Kappes) created - - [fix input --until-bytes: now stops at any of given bytes](https://github.com/nushell/nushell/pull/10235) - - [Tests: clean up unnecessary use of pipeline()](https://github.com/nushell/nushell/pull/10170) -- [amtoine](https://github.com/amtoine) created - - [fix the pretty printing of failing tests in std](https://github.com/nushell/nushell/pull/10373) - - [add `std repeat` command to replace `"foo" * 3`](https://github.com/nushell/nushell/pull/10339) - - [add case-insensitive example to `where`](https://github.com/nushell/nushell/pull/10299) - - [allow `into duration` to take an integer amount of ns](https://github.com/nushell/nushell/pull/10286) - - [rename the types with spaces in them to use `-`](https://github.com/nushell/nushell/pull/9929) - - [fix default after an empty where](https://github.com/nushell/nushell/pull/10240) - - [move math constants to standard library](https://github.com/nushell/nushell/pull/9678) - - [support tab completion cycling](https://github.com/nushell/nushell/pull/10199) - - [add support for Vim motions in `explore`](https://github.com/nushell/nushell/pull/9966) -- [WindSoilder](https://github.com/WindSoilder) created - - [Ps: add `cwd` column on linux and macos](https://github.com/nushell/nushell/pull/10347) - - [return error when user break sleep by ctrl-c](https://github.com/nushell/nushell/pull/10234) -- [jntrnr](https://github.com/jntrnr) created - - [fix 'let' to properly redirect](https://github.com/nushell/nushell/pull/10360) - - [Change `echo` to print when not redirected](https://github.com/nushell/nushell/pull/10338) - - [remove profiling from nushell's hot loop](https://github.com/nushell/nushell/pull/10325) - - [Move Value to helpers, separate span call](https://github.com/nushell/nushell/pull/10121) - - [Spanned Value step 1: span all value cases](https://github.com/nushell/nushell/pull/10042) -- [GomesGoncalo](https://github.com/GomesGoncalo) created - - [fix #10319: allow json request of value type list](https://github.com/nushell/nushell/pull/10356) -- [Tiggax](https://github.com/Tiggax) created - - [Remove `select` error if same row/column is provided](https://github.com/nushell/nushell/pull/10350) - - [update `reject` to be able to recive arg list](https://github.com/nushell/nushell/pull/10216) - - [`reject` multiple row args support](https://github.com/nushell/nushell/pull/10163) -- [kubouch](https://github.com/kubouch) created - - [Allow parse-time evaluation of `if`](https://github.com/nushell/nushell/pull/10326) - - [Remove leftover const eval file](https://github.com/nushell/nushell/pull/10324) - - [Add NU_VERSION environment variable on startup](https://github.com/nushell/nushell/pull/10177) - - [Make $nu constant](https://github.com/nushell/nushell/pull/10160) - - [Allow parse-time evaluation of calls, pipelines and subexpressions](https://github.com/nushell/nushell/pull/9499) -- [hustcer](https://github.com/hustcer) created - - [Update Nu to v0.84 for release and nightly-build](https://github.com/nushell/nushell/pull/10334) - - [Upgrade softprops/action-gh-release to v0.1.15 for release and nightly build workflow](https://github.com/nushell/nushell/pull/10331) -- [geniusisme](https://github.com/geniusisme) created - - [provide env to commands and try to start provided path](https://github.com/nushell/nushell/pull/10302) -- [utouto97](https://github.com/utouto97) created - - [add 'from ndjson' into standard library](https://github.com/nushell/nushell/pull/10283) - - [refactor input command](https://github.com/nushell/nushell/pull/10150) -- [nanoqsh](https://github.com/nanoqsh) created - - [Keep order for `par-each`](https://github.com/nushell/nushell/pull/10249) - - [Make `append`/`prepend` consistent for ranges](https://github.com/nushell/nushell/pull/10231) -- [app/dependabot](https://github.com/app/dependabot) created - - [Bump bytesize from 1.2.0 to 1.3.0](https://github.com/nushell/nushell/pull/10306) - - [Bump tempfile from 3.7.0 to 3.8.0](https://github.com/nushell/nushell/pull/10307) - - [Bump actions/checkout from 3 to 4](https://github.com/nushell/nushell/pull/10308) - - [Bump itertools from 0.10.5 to 0.11.0](https://github.com/nushell/nushell/pull/9524) - - [Bump rust-embed from 6.8.1 to 8.0.0](https://github.com/nushell/nushell/pull/10208) - - [Bump git2 from 0.17.2 to 0.18.0](https://github.com/nushell/nushell/pull/10207) - - [Bump winreg from 0.50.0 to 0.51.0](https://github.com/nushell/nushell/pull/10209) - - [Bump notify-debouncer-full from 0.2.0 to 0.3.1](https://github.com/nushell/nushell/pull/10129) -- [dmatos2012](https://github.com/dmatos2012) created - - [Fix variables not allowed in ucp](https://github.com/nushell/nushell/pull/10304) - - [use uutils/coreutils cp command in place of nushell's cp command](https://github.com/nushell/nushell/pull/10097) -- [dzorya](https://github.com/dzorya) created - - [Added a comment that perl is required for feature static-link-openssl…](https://github.com/nushell/nushell/pull/10291) -- [nibon7](https://github.com/nibon7) created - - [Make cursor_shape optional](https://github.com/nushell/nushell/pull/10289) - - [Exit early when encountering parsing errors](https://github.com/nushell/nushell/pull/10213) - - [Auto format let-else block](https://github.com/nushell/nushell/pull/10214) - - [Use built-in is_terminal instead of is_terminal::is_terminal](https://github.com/nushell/nushell/pull/9550) - - [Don't use `oldtime` feature of chrono ](https://github.com/nushell/nushell/pull/9577) -- [alsuren](https://github.com/alsuren) created - - [signpost 'input list --types [key]' from 'keybindings list'](https://github.com/nushell/nushell/pull/10287) - - [Point from keybindings help to the book's reedline chapter](https://github.com/nushell/nushell/pull/10193) -- [IanManske](https://github.com/IanManske) created - - [Fix `rm` on macOS](https://github.com/nushell/nushell/pull/10282) - - [Restore initial foreground process group on exit](https://github.com/nushell/nushell/pull/10021) - - [Create `Record` type](https://github.com/nushell/nushell/pull/10103) -- [rgwood](https://github.com/rgwood) created - - [Start removing colour config from `explore`](https://github.com/nushell/nushell/pull/10270) - - [Exit explore on ctrl+c/d/q](https://github.com/nushell/nushell/pull/10257) - - [explore: remove `:config`, `:show-config`, `:tweak` commands](https://github.com/nushell/nushell/pull/10259) - - [Remove `exit_esc` and `show_banner` config from `explore`](https://github.com/nushell/nushell/pull/10258) - - [Fix watch not detecting modifications on Windows](https://github.com/nushell/nushell/pull/10109) -- [brunerm99](https://github.com/brunerm99) created - - [feat: Search terms for use, while, and range (#5093)](https://github.com/nushell/nushell/pull/10265) -- [balupton](https://github.com/balupton) created - - [readme: add dorothy to supported by](https://github.com/nushell/nushell/pull/10262) -- [stormasm](https://github.com/stormasm) created - - [change LOG_FORMAT to NU_LOG_FORMAT in nu-std library](https://github.com/nushell/nushell/pull/10254) - - [Move hook to nu_cmd_base](https://github.com/nushell/nushell/pull/10146) - - [remove warnings in nu_command tests](https://github.com/nushell/nushell/pull/10145) - - [update rust-toolchain doc to 4 weeks from 3](https://github.com/nushell/nushell/pull/10140) -- [horasal](https://github.com/horasal) created - - [Allow operator in constants](https://github.com/nushell/nushell/pull/10212) - - [treat path contains '?' as pattern](https://github.com/nushell/nushell/pull/10142) - - [prevent crash when use redirection with let/mut](https://github.com/nushell/nushell/pull/10139) - - [skip comments and eols while parsing pipeline](https://github.com/nushell/nushell/pull/10149) - - [handle empty pipeline while parsing let (fix Issue10083)](https://github.com/nushell/nushell/pull/10116) - - [Add encoding auto-detection for `decode`](https://github.com/nushell/nushell/pull/10030) -- [dead10ck](https://github.com/dead10ck) created - - [Clean up trash support on Android](https://github.com/nushell/nushell/pull/10225) - - [Fix unit tests on Android](https://github.com/nushell/nushell/pull/10224) - - [upgrade nix to 0.27](https://github.com/nushell/nushell/pull/10223) - - [Support Termux](https://github.com/nushell/nushell/pull/10013) -- [ofek](https://github.com/ofek) created - - [Fix example history command pipeline](https://github.com/nushell/nushell/pull/10220) -- [MasterMach50](https://github.com/MasterMach50) created - - [changed default env file to use $nu.home_path to find home](https://github.com/nushell/nushell/pull/10192) -- [matthias-Q](https://github.com/matthias-Q) created - - [feat: allow `from csv` to accept 4 byte unicode separator chars](https://github.com/nushell/nushell/pull/10138) - - [Allow for `.parq` file ending as alternative to `.parquet`](https://github.com/nushell/nushell/pull/10112) -- [ayax79](https://github.com/ayax79) created - - [fixed usages of deprecated chrono DateTime::from_utc](https://github.com/nushell/nushell/pull/10161) - - [Updating polars and sqlparser versions](https://github.com/nushell/nushell/pull/10114) -- [SED4906](https://github.com/SED4906) created - - [Update removed "MDI" icons to current MD icons](https://github.com/nushell/nushell/pull/10126) -- [JoaquinTrinanes](https://github.com/JoaquinTrinanes) created - - [Screen reader-friendly errors](https://github.com/nushell/nushell/pull/10122) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [toolkit: Renames `pretty-print-command`](https://github.com/nushell/nushell/pull/10110) - - [Add notice to enable develop mode on Windows](https://github.com/nushell/nushell/pull/10111) -- [herobs](https://github.com/herobs) created - - [Fix 9156 endian consistency](https://github.com/nushell/nushell/pull/9873) -- [ito-hiroki](https://github.com/ito-hiroki) created - - [Fix tab completion order of directories to consistent with order of files](https://github.com/nushell/nushell/pull/10102) - -## Extension -- [nerditation](https://github.com/nerditation) created - - [use `which` to search `nu` location, add icon too.](https://github.com/nushell/vscode-nushell-lang/pull/153) -- [adamcstephens](https://github.com/adamcstephens) created - - [fix shebang/firstLine detection](https://github.com/nushell/vscode-nushell-lang/pull/151) - -## Documentation -- [Gryff](https://github.com/Gryff) created - - [Change direnv example to upload $env.PATH as a list](https://github.com/nushell/nushell.github.io/pull/1058) -- [edhowland](https://github.com/edhowland) created - - [Changed Python plugin example to be more portable](https://github.com/nushell/nushell.github.io/pull/1060) -- [dnsem](https://github.com/dnsem) created - - [Support for standard input in script with shebang](https://github.com/nushell/nushell.github.io/pull/1057) -- [petrisch](https://github.com/petrisch) created - - [DE translation for custom_completions.md](https://github.com/nushell/nushell.github.io/pull/1056) - - [Typos in custom_completions](https://github.com/nushell/nushell.github.io/pull/1052) -- [mb21](https://github.com/mb21) created - - [Cookbook setup: fix command to append to PATH](https://github.com/nushell/nushell.github.io/pull/1055) -- [connorjs](https://github.com/connorjs) created - - [Update variables_and_subexpressions.md - remove obsolete section](https://github.com/nushell/nushell.github.io/pull/1054) - - [Update working_with_lists.md - format date](https://github.com/nushell/nushell.github.io/pull/1053) -- [JoaquinTrinanes](https://github.com/JoaquinTrinanes) created - - [Fix external completers typo](https://github.com/nushell/nushell.github.io/pull/1051) - - [Simplify external completer](https://github.com/nushell/nushell.github.io/pull/1049) - - [Error style section](https://github.com/nushell/nushell.github.io/pull/1026) -- [hustcer](https://github.com/hustcer) created - - [Update min required node version and some node modules](https://github.com/nushell/nushell.github.io/pull/1050) -- [sholderbach](https://github.com/sholderbach) created - - [Document that `open` looks up `from`s in scope](https://github.com/nushell/nushell.github.io/pull/1048) -- [stormasm](https://github.com/stormasm) created - - [add a link to the contributor book at the end of the plugins chapter](https://github.com/nushell/nushell.github.io/pull/1045) -- [alsuren](https://github.com/alsuren) created - - [Point out where command docs should be edited](https://github.com/nushell/nushell.github.io/pull/1042) -- [dclausen](https://github.com/dclausen) created - - [Update cheat_sheet.md](https://github.com/nushell/nushell.github.io/pull/1039) -- [simonboots](https://github.com/simonboots) created - - [Fix small typo in modules.md](https://github.com/nushell/nushell.github.io/pull/1038) -- [leetemil](https://github.com/leetemil) created - - [Update docs for exiting shell in shells](https://github.com/nushell/nushell.github.io/pull/1037) -- [adamchalmers](https://github.com/adamchalmers) created - - [Clarify how to check config file paths](https://github.com/nushell/nushell.github.io/pull/1030) - - [Link to escape when discussing escapes](https://github.com/nushell/nushell.github.io/pull/1031) -- [follower](https://github.com/follower) created - - [Move launch instructions earlier in page.](https://github.com/nushell/nushell.github.io/pull/1032) -- [jamesarch](https://github.com/jamesarch) created - - [fix missing command](https://github.com/nushell/nushell.github.io/pull/1034) -- [narve](https://github.com/narve) created - - [Update loading_data.md, correct link to http command](https://github.com/nushell/nushell.github.io/pull/1033) -- [dlamei](https://github.com/dlamei) created - - [fix typo in book](https://github.com/nushell/nushell.github.io/pull/1028) -- [lomm28](https://github.com/lomm28) created - - [nu cheat sheet added](https://github.com/nushell/nushell.github.io/pull/1025) -- [fdncred](https://github.com/fdncred) created - - [update fdncred's item + typo](https://github.com/nushell/nushell.github.io/pull/1022) -- [rgwood](https://github.com/rgwood) created - - [Update Reilly's comments in birthday blog post](https://github.com/nushell/nushell.github.io/pull/1021) -- [app/github-actions](https://github.com/app/github-actions) created - - [Compressed Images](https://github.com/nushell/nushell.github.io/pull/1020) -- [jntrnr](https://github.com/jntrnr) created - - [Add Nushell birthday post](https://github.com/nushell/nushell.github.io/pull/1019) - -## Nu_Scripts -- [amtoine](https://github.com/amtoine) created - - [fix scripts](https://github.com/nushell/nu_scripts/pull/594) - - [add a `typeof` command](https://github.com/nushell/nu_scripts/pull/597) - - [add `$.type` to `package.nuon`](https://github.com/nushell/nu_scripts/pull/582) - - [add the `random-bytes` benchmark](https://github.com/nushell/nu_scripts/pull/595) -- [WindSoilder](https://github.com/WindSoilder) created - - [Improve background job.nu](https://github.com/nushell/nu_scripts/pull/607) - - [use closure instead of block](https://github.com/nushell/nu_scripts/pull/602) -- [Zinvoke](https://github.com/Zinvoke) created - - [FEATURE: add `catppuccin-mocha` theme](https://github.com/nushell/nu_scripts/pull/601) -- [brunerm99](https://github.com/brunerm99) created - - [Change nu_conda list to output active status of environment as well (#604)](https://github.com/nushell/nu_scripts/pull/605) -- [icp1994](https://github.com/icp1994) created - - [feat(hook): add `rusty-paths.nu`](https://github.com/nushell/nu_scripts/pull/596) -- [selfagency](https://github.com/selfagency) created - - [Add support for fnm](https://github.com/nushell/nu_scripts/pull/593) -- [fnuttens](https://github.com/fnuttens) created - - [Replace exa by eza aliases](https://github.com/nushell/nu_scripts/pull/591) -- [maxim-uvarov](https://github.com/maxim-uvarov) created - - [Update `bar` function](https://github.com/nushell/nu_scripts/pull/589) -- [StripedMonkey](https://github.com/StripedMonkey) created - - [Expand git completions](https://github.com/nushell/nu_scripts/pull/587) -- [AntoineSebert](https://github.com/AntoineSebert) created - - [Add `dfr` before `into df` and `into nu`](https://github.com/nushell/nu_scripts/pull/585) - -## Reedline -- [sholderbach](https://github.com/sholderbach) created - - [Remove old `actions-rs/cargo`](https://github.com/nushell/reedline/pull/637) - - [Add a configuration to codecov.io](https://github.com/nushell/reedline/pull/636) - - [Setup coverage with codecov.io](https://github.com/nushell/reedline/pull/635) - - [Bump `crossterm` to 0.27.0](https://github.com/nushell/reedline/pull/625) -- [ysthakur](https://github.com/ysthakur) created - - [Let prompts choose to repaint on enter](https://github.com/nushell/reedline/pull/627) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [Minor improvements](https://github.com/nushell/reedline/pull/633) - - [Fix `read_line` docs](https://github.com/nushell/reedline/pull/629) -- [Abdillah](https://github.com/Abdillah) created - - [Add Kitty protocol keyboard enhancement support](https://github.com/nushell/reedline/pull/607) diff --git a/blog/2023-12-12-nushell_0_88_0.md b/blog/2023-12-12-nushell_0_88_0.md deleted file mode 100644 index 4511a055596..00000000000 --- a/blog/2023-12-12-nushell_0_88_0.md +++ /dev/null @@ -1,769 +0,0 @@ ---- -title: Nushell 0.88.0 -author: The Nu Authors -author_site: https://twitter.com/nu_shell -author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.88.0 of Nu. This release adds a spread operator, output stream improvements, dynamic switch support, and much more. ---- - - -# Nushell 0.88.0 - -Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. - -Today, we're releasing version 0.88.0 of Nu. This release adds a spread operator, output stream improvements, dynamic switch support, and much more. - -# Where to get it - -Nu 0.88.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.88.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. - -::: tip Note -The optional dataframe functionality is available by `cargo install nu --features=dataframe`. -::: - -As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_`. - -# Table of content -- [*Themes of this release / New features*](#themes-of-this-release-new-features-toc) - - [*Hall of fame*](#hall-of-fame-toc) - - [*Bug fixes*](#bug-fixes-toc) - - [*Enhancing the documentation*](#enhancing-the-documentation-toc) - - [*New _spread_ operator for list and record literals*](#new-spread-operator-for-list-and-record-literals-toc) - - [*Passing boolean switches dynamically*](#passing-boolean-switches-dynamically-toc) - - [*Redirection to standard streams is getting better*](#redirection-to-standard-streams-is-getting-better-toc) - - [*One-time theming of tables is there*](#one-time-theming-of-tables-is-there-toc) - - [*Exposing name of script to the wild*](#exposing-name-of-script-to-the-wild-toc) - - [*Parsing human-friendly dates into Nushell values*](#parsing-human-friendly-dates-into-nushell-values-toc) - - [*Show found externals via syntax highlighting in the REPL*](#show-found-externals-via-syntax-highlighting-in-the-repl-toc) - - [*New "out of bound" error*](#new-out-of-bound-error-toc) - - [*Details on the `0.87.1` hotfix release*](#details-on-the-0-87-1-hotfix-release-toc) - - [*Need help to wrap... commands?*](#need-help-to-wrap-commands-toc) - - [*Restricting use of internal variables*](#restricting-use-of-internal-variables-toc) - - [*A small update on the LSP*](#a-small-update-on-the-lsp-toc) - - [*Our set of commands is evolving*](#our-set-of-commands-is-evolving-toc) - - [*New commands*](#new-commands-toc) - - [*Changes to existing commands*](#changes-to-existing-commands-toc) - - [*Deprecated commands*](#deprecated-commands-toc) - - [*Removed commands*](#removed-commands-toc) -- [*Breaking changes*](#breaking-changes-toc) -- [*Full changelog*](#full-changelog-toc) - -# Themes of this release / New features [[toc](#table-of-content)] - - - -## Hall of fame [[toc](#table-of-content)] -### Bug fixes [[toc](#table-of-content)] -Thanks to all the contributors below for helping us solve issues and bugs :pray: -| author | description | url | -| ------------------------------------ | ----------- | ------------------------------------------------------- | -| [@dead10ck](https://github.com/dead10ck) | into binary -c: return 0 as single byte | [#11068](https://github.com/nushell/nushell/pull/11068) | -| [@zhiburt](https://github.com/zhiburt) | Fix #11047 | [#11054](https://github.com/nushell/nushell/pull/11054) | -| [@fdncred](https://github.com/fdncred) | tweak `table` example/parameter text | [#11071](https://github.com/nushell/nushell/pull/11071) | -| [@fdncred](https://github.com/fdncred) | add "default" table theme | [#11072](https://github.com/nushell/nushell/pull/11072) | -| [@fdncred](https://github.com/fdncred) | correct table example syntax | [#11074](https://github.com/nushell/nushell/pull/11074) | -| [@fdncred](https://github.com/fdncred) | optimize/clean up a few of the `table` changes | [#11076](https://github.com/nushell/nushell/pull/11076) | -| [@sophiajt](https://github.com/sophiajt) | Fix the output type for 'view files' | [#11077](https://github.com/nushell/nushell/pull/11077) | -| [@danielsomerfield](https://github.com/danielsomerfield) | Fix toolkit to run workspace on 'check pr' (issue #10906) | [#11112](https://github.com/nushell/nushell/pull/11112) | -| [@hustcer](https://github.com/hustcer) | Exit the release job if creating binary package failed | [#11145](https://github.com/nushell/nushell/pull/11145) | -| [@hustcer](https://github.com/hustcer) | Fix release and nightly build workflow | [#11146](https://github.com/nushell/nushell/pull/11146) | -| [@amtoine](https://github.com/amtoine) | fix the link to the `nu_scripts` in `std clip` deprecation | [#11150](https://github.com/nushell/nushell/pull/11150) | -| [@NotLebedev](https://github.com/NotLebedev) | Cp target expansion | [#11152](https://github.com/nushell/nushell/pull/11152) | -| [@MarikaChlebowska](https://github.com/MarikaChlebowska) | Add metadata to some filters | [#11160](https://github.com/nushell/nushell/pull/11160) | -| [@sholderbach](https://github.com/sholderbach) | Revert "Adding support for Polars structs" | [#11171](https://github.com/nushell/nushell/pull/11171) | -| [@sigoden](https://github.com/sigoden) | Fix spans passed to external_completer | [#11008](https://github.com/nushell/nushell/pull/11008) | -| [@nibon7](https://github.com/nibon7) | Add boundary check for str index-of | [#11190](https://github.com/nushell/nushell/pull/11190) | -| [@WindSoilder](https://github.com/WindSoilder) | When using redirection, if a command generates non-zero exit code, the script should stop running | [#11191](https://github.com/nushell/nushell/pull/11191) | -| [@nibon7](https://github.com/nibon7) | Fix span of invalid range | [#11207](https://github.com/nushell/nushell/pull/11207) | -| [@nibon7](https://github.com/nibon7) | Fix capacity overflow caused by large range of ports | [#11210](https://github.com/nushell/nushell/pull/11210) | -| [@IanManske](https://github.com/IanManske) | Fix `get -i` ignoring errors for only the first cellpath | [#11213](https://github.com/nushell/nushell/pull/11213) | -| [@dtolnay](https://github.com/dtolnay) | Fix `Option<&str> == Option<&String>` build error when using rust_decimal/rkyv feature | [#11205](https://github.com/nushell/nushell/pull/11205) | -| [@nibon7](https://github.com/nibon7) | Add checks for ports | [#11214](https://github.com/nushell/nushell/pull/11214) | -| [@ysthakur](https://github.com/ysthakur) | Fix highlighting of spread subexpressions in records | [#11202](https://github.com/nushell/nushell/pull/11202) | -| [@nibon7](https://github.com/nibon7) | Fix overlay_use_main_not_exported hanging when an external spam command exists | [#11261](https://github.com/nushell/nushell/pull/11261) | -| [@AucaCoyan](https://github.com/AucaCoyan) | :bug: Fixes markdown formatting on LSP hover | [#11253](https://github.com/nushell/nushell/pull/11253) | -| [@MarikaChlebowska](https://github.com/MarikaChlebowska) | Add more descriptive error message when passing list to from_csv | [#10962](https://github.com/nushell/nushell/pull/10962) | -| [@sophiajt](https://github.com/sophiajt) | Respect non-zero exit code in subexpressions and blocks | [#8984](https://github.com/nushell/nushell/pull/8984) | -| [@WindSoilder](https://github.com/WindSoilder) | Error on `use path item1 item2`, if item1 is not a module | [#11183](https://github.com/nushell/nushell/pull/11183) | -| [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) | Match `++=` capabilities with `++` | [#11130](https://github.com/nushell/nushell/pull/11130) | -| [@fdncred](https://github.com/fdncred) | Add nu lib dirs default | [#11248](https://github.com/nushell/nushell/pull/11248) | - -### Enhancing the documentation [[toc](#table-of-content)] -Thanks to all the contributors below for helping us making the documentation of Nushell commands better :pray: -| author | description | url | -| ------------------------------------------------ | ---------------------------------------------------------------------------- | ------------------------------------------------------- | -| [@sholderbach](https://github.com/sholderbach) | Curate developer documentation in tree | [#11052](https://github.com/nushell/nushell/pull/11052) | -| [@IanManske](https://github.com/IanManske) | Build `nu-protocol` docs with all features enabled | [#11180](https://github.com/nushell/nushell/pull/11180) | -| [@poliorcetics](https://github.com/poliorcetics) | feat: Add default docs for aliases, generated from the command they point to | [#10825](https://github.com/nushell/nushell/pull/10825) | -| [@amtoine](https://github.com/amtoine) | fix `nu-std` README | [#11244](https://github.com/nushell/nushell/pull/11244) | - -### Working on internals [[toc](#table-of-content)] -Thanks to all the contributors below for working on internals of Nushell, such as refactoring the code :pray: -| author | description | url | -| ---------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------- | -| [@fdncred](https://github.com/fdncred) | bump rust-toolchain to 1.72.1 | [#11079](https://github.com/nushell/nushell/pull/11079) | -| [@nibon7](https://github.com/nibon7) | Apply nightly clippy fixes | [#11083](https://github.com/nushell/nushell/pull/11083) | -| [@drbrain](https://github.com/drbrain) | Convert ShellError::CommandNotFound to named fields | [#11094](https://github.com/nushell/nushell/pull/11094) | -| [@drbrain](https://github.com/drbrain) | Convert ShellError::NetworkFailure to named fields | [#11093](https://github.com/nushell/nushell/pull/11093) | -| [@drbrain](https://github.com/drbrain) | Add Argument::span() and Call::arguments_span() | [#10983](https://github.com/nushell/nushell/pull/10983) | -| [@IanManske](https://github.com/IanManske) | Refactor `Value` cell path functions to fix bugs | [#11066](https://github.com/nushell/nushell/pull/11066) | -| [@sholderbach](https://github.com/sholderbach) | Bump version to `0.87.2` | [#11114](https://github.com/nushell/nushell/pull/11114) | -| [@sholderbach](https://github.com/sholderbach) | Bump `procfs` to 0.16.0 | [#11115](https://github.com/nushell/nushell/pull/11115) | -| [@drbrain](https://github.com/drbrain) | Remove ShellError::FlagNotFound | [#11119](https://github.com/nushell/nushell/pull/11119) | -| [@drbrain](https://github.com/drbrain) | Convert ShellError::AliasNotFound to named fields | [#11118](https://github.com/nushell/nushell/pull/11118) | -| [@drbrain](https://github.com/drbrain) | Convert FileNotFound to named fields | [#11120](https://github.com/nushell/nushell/pull/11120) | -| [@hustcer](https://github.com/hustcer) | Upgrade Nu and script for release workflow | [#11121](https://github.com/nushell/nushell/pull/11121) | -| [@sholderbach](https://github.com/sholderbach) | Use record API in `describe --detailed` | [#11075](https://github.com/nushell/nushell/pull/11075) | -| [@drbrain](https://github.com/drbrain) | Convert FileNotFoundCustom to named fields | [#11123](https://github.com/nushell/nushell/pull/11123) | -| [@drbrain](https://github.com/drbrain) | Convert PluginFailedToLoad to named fields | [#11124](https://github.com/nushell/nushell/pull/11124) | -| [@drbrain](https://github.com/drbrain) | Convert PluginFailedToEncode to named fields | [#11125](https://github.com/nushell/nushell/pull/11125) | -| [@drbrain](https://github.com/drbrain) | Convert PluginFailedToDecode to named fields | [#11126](https://github.com/nushell/nushell/pull/11126) | -| [@sholderbach](https://github.com/sholderbach) | Move more commands to opaque `Record` type | [#11122](https://github.com/nushell/nushell/pull/11122) | -| [@rfaulhaber](https://github.com/rfaulhaber) | Bump `sysinfo` to 0.29.11 | [#11166](https://github.com/nushell/nushell/pull/11166) | -| [@drbrain](https://github.com/drbrain) | Convert more ShellError variants to named fields | [#11173](https://github.com/nushell/nushell/pull/11173) | -| [@WindSoilder](https://github.com/WindSoilder) | add echo_env_mixed testbin to reduce windows only tests | [#11172](https://github.com/nushell/nushell/pull/11172) | -| [@cosineblast](https://github.com/cosineblast) | Remove file I/O from tests that don't need it | [#11182](https://github.com/nushell/nushell/pull/11182) | -| [@drbrain](https://github.com/drbrain) | Convert more ShellError variants to named fields | [#11222](https://github.com/nushell/nushell/pull/11222) | -| [@nibon7](https://github.com/nibon7) | Explicitly indicate duplicate flags | [#11226](https://github.com/nushell/nushell/pull/11226) | -| [@ysthakur](https://github.com/ysthakur) | Reduce code duplication in eval.rs and eval_const.rs | [#11192](https://github.com/nushell/nushell/pull/11192) | -| [@ayax79](https://github.com/ayax79) | Upgrading to polars 0.35 | [#11241](https://github.com/nushell/nushell/pull/11241) | -| [@IanManske](https://github.com/IanManske) | Remove unnecessary boxing of `Stack::recursion_count` | [#11238](https://github.com/nushell/nushell/pull/11238) | -| [@schrieveslaach](https://github.com/schrieveslaach) | Upgrade lsp-server Dependency | [#11252](https://github.com/nushell/nushell/pull/11252) | -| [@drbrain](https://github.com/drbrain) | Convert `Shellerror::GenericError` to named fields | [#11230](https://github.com/nushell/nushell/pull/11230) | -| [@sholderbach](https://github.com/sholderbach) | Bump version to `0.87.1` | [#11056](https://github.com/nushell/nushell/pull/11056) | -| [@dead10ck](https://github.com/dead10ck) | Testing support tweaks: exit status in `Outcome` | [#10692](https://github.com/nushell/nushell/pull/10692) | -| [@nibon7](https://github.com/nibon7) | Simplify `clear` implementation | [#11273](https://github.com/nushell/nushell/pull/11273) | -| [@drbrain](https://github.com/drbrain) | Convert remainder of ShellError variants to named fields | [#11276](https://github.com/nushell/nushell/pull/11276) | - -## New _spread_ operator for list and record literals [[toc](#table-of-content)] - -[#10598](https://github.com/nushell/nushell/issues/10598) asked for a spread operator (`...`), and in [#11006](https://github.com/nushell/nushell/pull/11006) -and [#11144](https://github.com/nushell/nushell/pull/11144/), [@ysthakur](https://github.com/ysthakur/) implemented a spread operator in lists and records, respectively. -Spreading arguments to commands has not been implemented yet. - -The spread operator can help you avoid `append` in lists, e.g., this: -```nushell -let list = ["foo"] -[ - 1, - ...$list, - ...("foo" | split chars), - ...[3 9], - [] -] | to nuon -``` -will give: -```nushell -[1, foo, f, o, o, 3, 9, []] -``` - -In records, it can help you avoid `merge`, e.g., this: -```nushell -let record = { a: "foo" } -{ - ...$record, - y: "bar", - ...{ z: 2 } -} | to nuon -``` -will give: -```nushell -{a: foo, y: bar, z: 2} -``` - -You can spread variables, subexpressions, and either lists (inside list literals) or records (inside record literals). -Note that there needs to be no whitespace between the `...` and the expression being spread. - -## Passing boolean switches dynamically [[toc](#table-of-content)] -In last release, a distinction has been introduced between switches, e.g. `--enable-feature`, and -boolean options, e.g. `--do-something: bool`. -The former is simply used as `--enable-feature` and the latter expects a value as -`--do-something false`. - -Up until now, this had the downside of disallowing one to pass boolean switches to inner calls of -commands. -An example would be two commands, `foo` and `bar`, which both have a `--switch` and where `foo` is -calling `bar` internally with the opposite switch. It would have to look something like -```nushell -def bar [--switch] { - print $"switch in bar: ($switch)" -} - -def foo [--switch] { - print $"switch in foo: ($switch)" - if $switch { - bar - } else { - bar --switch - } -} -``` -or `bar` would have to take a boolean value instead of a switch, which would make the command less -nice to use as part of a public API... -```nushell -def bar [--switch: bool] { - print $"switch in bar: ($switch)" -} - -def foo [--switch] { - print $"switch in foo: ($switch)" - bar --switch (not $switch) -} -``` - -In this release and thanks to the work of [@WindSoilder](https://github.com/WindSoilder) in -[#11057](https://github.com/nushell/nushell/pull/11057), boolean switches can now be passed around. -This will simplify the code above and still preserve the nice signature of `bar` :partying: -```nushell -def bar [--switch] { - print $"switch in bar: ($switch)" -} - -def foo [--switch] { - print $"switch in foo: ($switch)" - bar --switch=(not $switch) -} -``` - -## Redirection to standard streams is getting better [[toc](#table-of-content)] -Once again, [@WindSoilder](https://github.com/WindSoilder) has been working on the redirection -system of Nushell, fixing a bug and adding a new very nice feature: -- [#10851](https://github.com/nushell/nushell/pull/10851): one pipeline output stream can be - redirected and the other one used as input to the rest of the pipe. - Given the following Bash script called `foo.sh` that outputs both to _stdout_ and _stderr_ - ```sh - echo aaaaa - echo bbb 1>&2 - echo cc - ``` - it is now possible to run the following command, redirecting `bbb` to a file and the rest - to the `lines | each { ... }` part of the pipeline: - ```nushell - bash test.sh err> err.txt | lines | each { str length} - ``` - resulting in `[5, 2]` as expected and `bbb` inside `err.txt`. -- [#10764](https://github.com/nushell/nushell/pull/10764): append to file with the `>>` syntax - instead of overwriting with `>` - ```nushell - (1 + 2 + 3) out> sum.txt - "\n" out>> sum.txt - (4 + 5 + 6) out>> sum.txt - ``` - will create a file called `sum.txt` with the following content - ``` - 6 - 15 - ``` - -## One-time theming of tables is there [[toc](#table-of-content)] -A common question and feature request from the community was: _how can i change the theme of Nushell -tables for just one command?_ - -Because of how Nushell works, the way to do that has been the following for a long time -```nushell -do { # use the scope of `do` to not alter the environment of the callee - $env.config.table.mode = "none" # set the theme - ls | table # call table to avoid just passing the value back to the callee and use the outside theme -} -``` - -In [#11058](https://github.com/nushell/nushell/pull/11058), [@zhiburt](https://github.com/zhiburt) -cracked the nut and added the long-wanted `table --theme` option. Below is a simple example: -- let's define a table -```nushell -let table = ls | where type == dir | reject type -``` -- and show it with a particular theme -```nushell -$table | table --theme ascii_rounded -``` -``` -.#--name----size-------modified------. -|0|assets |4.1 KB|2023-12-05 18:32:30| -|1|benches|4.1 KB|2023-12-09 22:33:44| -|2|crates |4.1 KB|2023-12-09 22:33:44| -|3|devdocs|4.1 KB|2023-12-09 22:33:44| -|4|docker |4.1 KB|2023-12-09 22:33:44| -|5|scripts|4.1 KB|2023-12-09 22:33:44| -|6|src |4.1 KB|2023-12-09 22:33:44| -|7|target |4.1 KB|2023-12-09 14:19:04| -|8|tests |4.1 KB|2023-12-05 18:32:30| -|9|wix |4.1 KB|2023-12-05 18:32:30| -'------------------------------------' -``` - -## Exposing name of script to the wild [[toc](#table-of-content)] -Coming from languages such as Python and Bash, it's quite expected to be able to access the name of -the script itself the same way it's been called from the CLI: with `sys.argv[0]` in Python and `$0` -in Bash. - -This was not possible in Nushell until the work of [@p00f](https://github.com/p00f) in -[#11203](https://github.com/nushell/nushell/pull/11203). -This will expose to any script a new environment variable called `$env.PROCESS_PATH` and which will -contain precisely something akin to `argv[0]`! -```nushell -#!/usr/bin/env nu -# in demo.nu - -def main [] { - printf $"I was called as ($env.PROCESS_PATH)" -} -``` -```nushell -demo.nu # will show "I was called as demo.nu" -./demo.nu # will show "I was called as ./demo.nu" -/path/to/demo.nu # will show "I was called as /path/to/demo.nu" -``` - -## Parsing human-friendly dates into Nushell values [[toc](#table-of-content)] -In [#11051](https://github.com/nushell/nushell/pull/11051), [@fdncred](https://github.com/fdncred) -added to `into datetime` the ability to parse _human readable_ dates into Nushell `datetime`. -This allows to write crazy things like -```nushell -"Now" | into datetime # same as `date now` -"A week ago" | into datetime # same as `(date now) - 1wk` -``` - -::: tip Note -see the full list of examples with `into datetime --list-human` -::: - -## Show found externals via syntax highlighting in the [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) [[toc](#table-of-content)] -We've added a new experimental feature that changes the syntax highlighting of text in the command position in the repl. Here's how it works. As you type, if a command is found with the current letter you've typed, the command will be highlighted according to your configuration of your color theme, specifically `shape_external_resolved`. As you keep typing, `which` fires to find out if the command is found or not. This allows you to know whether you've created a typo before you ever hit enter in the nushell repl. - -Since this might have a performance impact, we've put this behind a configuration point named `highlight_resolved_externals` in the config.nu file. Set it to `true` to enable this functionality and `false` to disable it. It defaults to `false`. - -Right now, with a dark theme, here's one way of configuring these colors, in the config.nu color theme, that showcases this funcitonality. Also, make sure you have `highlight_resolved_externals` set to `true`. - -```nushell - shape_internalcall: cyan_bold # internal commands that are found will be this color - shape_external: darkorange # external "commands" that do not exist, will be this color - shape_external_resolved: light_yellow_bold # external commands that are found with `which`, will be this color -``` -You can read more about it and see a gif in [#11135](https://github.com/nushell/nushell/pull/11135) where [@fdncred](https://github.com/fdncred) implemented the feature. - -## New "out of bound" error [[toc](#table-of-content)] -[@nibon7](https://github.com/nibon7) introduces in -[#11201](https://github.com/nushell/nushell/pull/11201) a new error which is -pretty common to programming languages: the "out of bound" error. - -This will cause the following command to give an "out of bound" error: -```nushell -"foo" | str index-of '' --range 10..11 -``` - -## Details on the `0.87.1` hotfix release [[toc](#table-of-content)] -In between the last `0.87.0` release and the one from today, there has been a quick hotfix release -to address two major bugs to two quite important filesystem commands: `rm` and `cp`. - -Below are some details about these two bug fixes: -- [@IanManske](https://github.com/IanManske) fixed `rm` in - [#11064](https://github.com/nushell/nushell/pull/11064) which has - [trouble removing files after a `cd`](https://github.com/nushell/nushell/issues/11061) -- [@kubouch](https://github.com/kubouch) fixed a similar one about `cp` in - [#11080](https://github.com/nushell/nushell/pull/11080), addressing - [#10832](https://github.com/nushell/nushell/issues/10832) - -## Need help to wrap... commands? [[toc](#table-of-content)] -In the previous release, the `extern-wrapped` command has been deprecated and it is -[now being removed](#removed-commands-toc). -An issue did persist though, making `def --wrapped` not a suitable replacement for the old command... -which was fixed in [#11235](https://github.com/nushell/nushell/pull/11235) by the changes from -[@KAAtheWiseGit](https://github.com/KAAtheWiseGit): `def --wrapped` commands won't create a help -page anymore, allowing to send `-h` and `--help` to other commands: -```nushell -def --wrapped foo [...rest] { echo $rest } -foo --help -h -``` -will give no help page -``` -─┬────── -0│--help -1│-h -─┴────── -``` - -## Restricting use of internal variables [[toc](#table-of-content)] -Nushell features some internal variables that users can't redeclare, i.e. `$nu`, `$env` and `$in`. -::: tip Note -`$env` is the special of the three because one can mutate it with -```nushell -$env.FOO = "i'm foo" -``` -but it is impossible to do `let env = 123` -::: - -However, up until now and the work of [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) -in [#11169](https://github.com/nushell/nushell/pull/11169) and -[#11228](https://github.com/nushell/nushell/pull/11228), it was possible to redefined these variables -in command definition: the code would parse and run, but you would get the internal values instead of -the ones passed to the command, which is a nasty silent bug! -From now on, the following will give an error -```nushell -def foo [nu] { print $nu } -``` -```nushell -def bar [env] { print $env } -``` -```nushell -def baz [in] { print $in } -``` - -Also, because `$nu` and `$env` don't have spans by construction, i.e. they are not defined in any -script where a span would make sense but rather internally when Nushell starts, accessing their -`metadata` does not make sense. This release makes the error more helpful: -```nushell -metadata $env -``` -``` -Error: × Built-in variables `$env` and `$nu` have no metadata - ╭─[entry #1:1:1] - 1 │ metadata $env - · ──┬─ - · ╰── no metadata available - ╰──── -``` - -## A small update on the LSP [[toc](#table-of-content)] -[@schrieveslaach](https://github.com/schrieveslaach) has been working again on the built-in LSP of -Nushell. -With [#10941](https://github.com/nushell/nushell/pull/10941), completions should get better with -this release :partying: - -## Our set of commands is evolving [[toc](#table-of-content)] -As usual, new release rhymes with changes to commands! - -### New commands [[toc](#table-of-content)] -- `is-terminal` by [@drbrain](https://github.com/drbrain) in [#10970](https://github.com/nushell/nushell/pull/10970) -- `std null-device` by [@WindSoilder](https://github.com/WindSoilder) in [#11070](https://github.com/nushell/nushell/pull/11070) -- `mktemp` by [@tskinn](https://github.com/tskinn) in [#11005](https://github.com/nushell/nushell/pull/11005) -- `stor` by [@fdncred](https://github.com/fdncred) in [#11170](https://github.com/nushell/nushell/pull/11170) => see the [section below](#a-local-in-memory-database-with-stor) - -#### A local in-memory database with `stor` - -With this release we've implemented a new sqlite family of commands called `stor`. `stor` is meant to be short for "storing data in an in-memory sqlite database". That's right, this family of commands supports an _in-memory_ database. This in-memory database will be accessible as long as they share the same executable instance. A new instance is created with each new nushell instance and the in-memory database cannot be shared between instances. We're exited to see what new things you'll invent with this technology, although we still consider it in the experimental phase. Please feel free to submit PRs to make the usage of it better and more robust. There are examples of how to use each command [in the PR](https://github.com/nushell/nushell/pull/11170). - -Here the summary you get when you execute the `stor` command. -```nushell -Usage: - > stor - -Subcommands: - stor create - Create a table in the in-memory sqlite database - stor delete - Delete a table or specified rows in the in-memory sqlite database - stor export - Export the in-memory sqlite database to a sqlite database file - stor import - Import a sqlite database file into the in-memory sqlite database - stor insert - Insert information into a specified table in the in-memory sqlite database - stor open - Opens the in-memory sqlite database - stor reset - Reset the in-memory database by dropping all tables - stor update - Update information in a specified table in the in-memory sqlite database - -Flags: - -h, --help - Display the help message for this command - -Input/output types: - ╭─#─┬──input──┬─output─╮ - │ 0 │ nothing │ string │ - ╰───┴─────────┴────────╯ -``` - -### Changes to existing commands [[toc](#table-of-content)] -- thanks to [@KAAtheWiseGit](https://github.com/KAAtheWiseGit) in [#11195](https://github.com/nushell/nushell/pull/11195), `input list` will accept more input/output types -- the `list -> string` I/O pair has been added to the `last` command by [@amtoine](https://github.com/amtoine) in [#11137](https://github.com/nushell/nushell/pull/11137) -- with the work of [@IanManske](https://github.com/IanManske) in [#11258](https://github.com/nushell/nushell/pull/11258), `insert`, `update` and `upsert` should now work more consistently with `list`s, e.g. -```nushell -[0, 2] | update 0 {|i| $i + 1 } # will give [1, 2] -[0, 1, 2] | insert 5 5 # will give "index too large" error -``` - -### Deprecated commands [[toc](#table-of-content)] -- `std clip` in [#11097](https://github.com/nushell/nushell/pull/11097): this command was handy but did not fit the [philosophy of the standard library](https://github.com/nushell/nushell/tree/main/crates/nu-std#--welcome-to-the-standard-library-of-nushell--) -- `std testing` in [#11151](https://github.com/nushell/nushell/pull/11151): even though in a VERY EARLY stage of its development, we would like to focus our efforts on the [Nupm](https://github.com/nushell/nupm) project and especially its simple `nupm test` command - -### Removed commands [[toc](#table-of-content)] -as part of the [deprecation plan of last release](https://www.nushell.sh/blog/2023-11-14-nushell_0_87_0.html#deprecated-commands-toc), -the following commands and options have been removed by [@amtoine](https://github.com/amtoine): -- `extern-wrapped` and `export extern-wrapped` in favor of `def --wrapped` in [#11000](https://github.com/nushell/nushell/pull/11000) -- `--not` from `glob` in favor of `--exclude` in [#10839](https://github.com/nushell/nushell/pull/10839) -- `size` in favor of `str stats` in [#10784](https://github.com/nushell/nushell/pull/10784) -- `unfold` in favor of `generate` in [#10773](https://github.com/nushell/nushell/pull/10773) -- `def-env` and `export def-env` in favor of `def --env` in [#10999](https://github.com/nushell/nushell/pull/10999) - -# Breaking changes [[toc](#table-of-content)] -- [#8984](https://github.com/nushell/nushell/pull/8984) Respect non-zero exit code in subexpressions and blocks - -Starting with this release, if a subexpression (eg `(echo foo.txt)`) or block (eg `if true { echo foo.txt }` evaluated to a non-zero exit code, it will no longer be lost and instead will be the exit code of that expression. This allows them to act more naturally when an external command fails. - -- [#11144](https://github.com/nushell/nushell/pull/11144) No longer allow `{a: 1, a: 2}` - -We now error if you repeat the same field name when creating a record, for example `{a: 1, a: 2}`. - -- [#10999](https://github.com/nushell/nushell/pull/10999) remove `def-env` and `export def-env` -- [#11000](https://github.com/nushell/nushell/pull/11000) remove `extern-wrapped` and `export extern-wrapped` - -We've removed the deprecated commands `def-env` and `export def-env`. Instead, use `def --env`. Likewise, we've done the same for `extern-wrapped` and `export extern-wrapped`. Instead, use `def --wrapped`. - -- [#10773](https://github.com/nushell/nushell/pull/10773) remove the `unfold` command - -We've renamed the previous `unfold` command. Instead, use the `generate` command. - -- [#10784](https://github.com/nushell/nushell/pull/10784) remove `size` command in favor of `str stats` - -We've also removed the `size` command, whch had an ambiguous name. Now, use `str stats` to get information about string content. - -- [#10839](https://github.com/nushell/nushell/pull/10839) remove `--not` from `glob` - -This releae replace the confusing `--not` flag of `glob` to instead be `glob --exclude`. - -- [#11058](https://github.com/nushell/nushell/pull/11058) nu-table/ Add `-t/theme` argument && Replace `-n/start-number` with `-i/index` - -To make how to update the table numbering more clear, we've replaced `table -n` with `table -i`/`table --index`. - -# Full changelog [[toc](#table-of-content)] -## Nushell -- [amtoine](https://github.com/amtoine) created - - [remove the `unfold` command](https://github.com/nushell/nushell/pull/10773) - - [remove `size` command in favor of `str stats`](https://github.com/nushell/nushell/pull/10784) - - [remove `--not` from `glob`](https://github.com/nushell/nushell/pull/10839) - - [remove `def-env` and `export def-env`](https://github.com/nushell/nushell/pull/10999) - - [remove `extern-wrapped` and `export extern-wrapped`](https://github.com/nushell/nushell/pull/11000) - - [deprecate `std clip`](https://github.com/nushell/nushell/pull/11097) - - [add `list -> string` to `last`](https://github.com/nushell/nushell/pull/11137) - - [fix the link to the `nu_scripts` in `std clip` deprecation](https://github.com/nushell/nushell/pull/11150) - - [deprecate `std testing`](https://github.com/nushell/nushell/pull/11151) - - [fix `nu-std` README](https://github.com/nushell/nushell/pull/11244) - - [add `nothing -> table` to `format date`](https://github.com/nushell/nushell/pull/11290) -- [app/dependabot](https://github.com/app/dependabot) created - - [Bump winreg from 0.51.0 to 0.52.0](https://github.com/nushell/nushell/pull/11102) - - [Bump uuid from 1.5.0 to 1.6.0](https://github.com/nushell/nushell/pull/11104) - - [Bump ureq from 2.8.0 to 2.9.1](https://github.com/nushell/nushell/pull/11163) - - [Bump openssl from 0.10.59 to 0.10.60](https://github.com/nushell/nushell/pull/11176) - - [Bump actions-rust-lang/setup-rust-toolchain from 1.5.0 to 1.6.0](https://github.com/nushell/nushell/pull/11223) -- [AucaCoyan](https://github.com/AucaCoyan) created - - [:bug: Fixes markdown formatting on LSP hover](https://github.com/nushell/nushell/pull/11253) -- [ayax79](https://github.com/ayax79) created - - [Upgrading to polars 0.35](https://github.com/nushell/nushell/pull/11241) -- [cosineblast](https://github.com/cosineblast) created - - [Remove file I/O from tests that don't need it](https://github.com/nushell/nushell/pull/11182) -- [danielsomerfield](https://github.com/danielsomerfield) created - - [Fix toolkit to run workspace on 'check pr' (issue #10906)](https://github.com/nushell/nushell/pull/11112) -- [dead10ck](https://github.com/dead10ck) created - - [Testing support tweaks: exit status in `Outcome`](https://github.com/nushell/nushell/pull/10692) - - [into binary -c: return 0 as single byte](https://github.com/nushell/nushell/pull/11068) -- [drbrain](https://github.com/drbrain) created - - [Add is-terminal to determine if stdin/out/err are a terminal](https://github.com/nushell/nushell/pull/10970) - - [Add Argument::span() and Call::arguments_span()](https://github.com/nushell/nushell/pull/10983) - - [Convert ShellError::NetworkFailure to named fields](https://github.com/nushell/nushell/pull/11093) - - [Convert ShellError::CommandNotFound to named fields](https://github.com/nushell/nushell/pull/11094) - - [Convert ShellError::AliasNotFound to named fields](https://github.com/nushell/nushell/pull/11118) - - [Remove ShellError::FlagNotFound](https://github.com/nushell/nushell/pull/11119) - - [Convert FileNotFound to named fields](https://github.com/nushell/nushell/pull/11120) - - [Convert FileNotFoundCustom to named fields](https://github.com/nushell/nushell/pull/11123) - - [Convert PluginFailedToLoad to named fields](https://github.com/nushell/nushell/pull/11124) - - [Convert PluginFailedToEncode to named fields](https://github.com/nushell/nushell/pull/11125) - - [Convert PluginFailedToDecode to named fields](https://github.com/nushell/nushell/pull/11126) - - [Convert more ShellError variants to named fields](https://github.com/nushell/nushell/pull/11173) - - [Convert more ShellError variants to named fields](https://github.com/nushell/nushell/pull/11222) - - [Convert `Shellerror::GenericError` to named fields](https://github.com/nushell/nushell/pull/11230) - - [Convert remainder of ShellError variants to named fields](https://github.com/nushell/nushell/pull/11276) - - [Ensure that command usage starts uppercase and ends period](https://github.com/nushell/nushell/pull/11278) -- [dtolnay](https://github.com/dtolnay) created - - [Fix `Option<&str> == Option<&String>` build error when using rust_decimal/rkyv feature](https://github.com/nushell/nushell/pull/11205) -- [fdncred](https://github.com/fdncred) created - - [allow parsing of human readable datetimes](https://github.com/nushell/nushell/pull/11051) - - [tweak `table` example/parameter text](https://github.com/nushell/nushell/pull/11071) - - [add "default" table theme](https://github.com/nushell/nushell/pull/11072) - - [correct table example syntax](https://github.com/nushell/nushell/pull/11074) - - [optimize/clean up a few of the `table` changes](https://github.com/nushell/nushell/pull/11076) - - [bump rust-toolchain to 1.72.1](https://github.com/nushell/nushell/pull/11079) - - [add shape `ExternalResolved` to show found externals via syntax highlighting in the repl](https://github.com/nushell/nushell/pull/11135) - - [Add `stor` family of commands](https://github.com/nushell/nushell/pull/11170) - - [add some tests for `stor create`](https://github.com/nushell/nushell/pull/11194) - - [Add nu lib dirs default](https://github.com/nushell/nushell/pull/11248) -- [hustcer](https://github.com/hustcer) created - - [Upgrade Nu and script for release workflow](https://github.com/nushell/nushell/pull/11121) - - [Exit the release job if creating binary package failed](https://github.com/nushell/nushell/pull/11145) - - [Fix release and nightly build workflow](https://github.com/nushell/nushell/pull/11146) -- [IanManske](https://github.com/IanManske) created - - [Fix `rm` path handling](https://github.com/nushell/nushell/pull/11064) - - [Refactor `Value` cell path functions to fix bugs](https://github.com/nushell/nushell/pull/11066) - - [Build `nu-protocol` docs with all features enabled](https://github.com/nushell/nushell/pull/11180) - - [Fix `get -i` ignoring errors for only the first cellpath](https://github.com/nushell/nushell/pull/11213) - - [Remove unnecessary boxing of `Stack::recursion_count`](https://github.com/nushell/nushell/pull/11238) - - [Fix replacement closures for `update`, `insert`, and `upsert`](https://github.com/nushell/nushell/pull/11258) -- [KAAtheWiseGit](https://github.com/KAAtheWiseGit) created - - [Match `++=` capabilities with `++`](https://github.com/nushell/nushell/pull/11130) - - [Forbid reserved variable names for function arguments](https://github.com/nushell/nushell/pull/11169) - - [Allow more types for `input list`](https://github.com/nushell/nushell/pull/11195) - - [Add special error for calling `metadata` on $env and $nu](https://github.com/nushell/nushell/pull/11228) - - [Do not create help for wrapped command](https://github.com/nushell/nushell/pull/11235) -- [kubouch](https://github.com/kubouch) created - - [Send only absolute paths to uu_cp](https://github.com/nushell/nushell/pull/11080) -- [MarikaChlebowska](https://github.com/MarikaChlebowska) created - - [Add more descriptive error message when passing list to from_csv](https://github.com/nushell/nushell/pull/10962) - - [Add metadata to some filters](https://github.com/nushell/nushell/pull/11160) -- [nibon7](https://github.com/nibon7) created - - [Apply nightly clippy fixes](https://github.com/nushell/nushell/pull/11083) - - [Add boundary check for str index-of](https://github.com/nushell/nushell/pull/11190) - - [Add OutOfBounds error](https://github.com/nushell/nushell/pull/11201) - - [Fix span of invalid range](https://github.com/nushell/nushell/pull/11207) - - [Fix capacity overflow caused by large range of ports](https://github.com/nushell/nushell/pull/11210) - - [Add checks for ports](https://github.com/nushell/nushell/pull/11214) - - [Explicitly indicate duplicate flags](https://github.com/nushell/nushell/pull/11226) - - [Fix overlay_use_main_not_exported hanging when an external spam command exists](https://github.com/nushell/nushell/pull/11261) - - [Simplify `clear` implementation](https://github.com/nushell/nushell/pull/11273) -- [NotLebedev](https://github.com/NotLebedev) created - - [Cp target expansion](https://github.com/nushell/nushell/pull/11152) -- [p00f](https://github.com/p00f) created - - [expose argv[0] as `$env.PROCESS_PATH`](https://github.com/nushell/nushell/pull/11203) -- [poliorcetics](https://github.com/poliorcetics) created - - [feat: Add default docs for aliases, generated from the command they point to](https://github.com/nushell/nushell/pull/10825) -- [rfaulhaber](https://github.com/rfaulhaber) created - - [Bump `sysinfo` to 0.29.11](https://github.com/nushell/nushell/pull/11166) -- [schrieveslaach](https://github.com/schrieveslaach) created - - [Implement LSP Text Document Synchronization](https://github.com/nushell/nushell/pull/10941) - - [Upgrade lsp-server Dependency](https://github.com/nushell/nushell/pull/11252) -- [sholderbach](https://github.com/sholderbach) created - - [Bump version for `0.87.0` release](https://github.com/nushell/nushell/pull/11031) - - [Move to clearer reedline keyboard enhancement API](https://github.com/nushell/nushell/pull/11045) - - [Curate developer documentation in tree](https://github.com/nushell/nushell/pull/11052) - - [Pin reedline to 0.26 release](https://github.com/nushell/nushell/pull/11053) - - [Bump version to `0.87.1`](https://github.com/nushell/nushell/pull/11056) - - [Use record API in `describe --detailed`](https://github.com/nushell/nushell/pull/11075) - - [Bump version to `0.87.2`](https://github.com/nushell/nushell/pull/11114) - - [Bump `procfs` to 0.16.0](https://github.com/nushell/nushell/pull/11115) - - [Move more commands to opaque `Record` type](https://github.com/nushell/nushell/pull/11122) - - [Revert "Adding support for Polars structs"](https://github.com/nushell/nushell/pull/11171) -- [sigoden](https://github.com/sigoden) created - - [Fix spans passed to external_completer](https://github.com/nushell/nushell/pull/11008) -- [sophiajt](https://github.com/sophiajt) created - - [Respect non-zero exit code in subexpressions and blocks](https://github.com/nushell/nushell/pull/8984) - - [Fix the output type for 'view files'](https://github.com/nushell/nushell/pull/11077) -- [tskinn](https://github.com/tskinn) created - - [Add `mktemp` command](https://github.com/nushell/nushell/pull/11005) -- [WindSoilder](https://github.com/WindSoilder) created - - [Support `o>>`, `e>>`, `o+e>>` to append output to an external file](https://github.com/nushell/nushell/pull/10764) - - [Redirect: support redirect stderr with piping stdout to next commands.](https://github.com/nushell/nushell/pull/10851) - - [fix custom command's default value](https://github.com/nushell/nushell/pull/11043) - - [enable to pass switch values dynamically](https://github.com/nushell/nushell/pull/11057) - - [std: add cross platform null-device name](https://github.com/nushell/nushell/pull/11070) - - [add echo_env_mixed testbin to reduce windows only tests](https://github.com/nushell/nushell/pull/11172) - - [Error on `use path item1 item2`, if item1 is not a module](https://github.com/nushell/nushell/pull/11183) - - [When using redirection, if a command generates non-zero exit code, the script should stop running](https://github.com/nushell/nushell/pull/11191) -- [ysthakur](https://github.com/ysthakur) created - - [Spread operator for list literals](https://github.com/nushell/nushell/pull/11006) - - [Spread operator in record literals](https://github.com/nushell/nushell/pull/11144) - - [Reduce code duplication in eval.rs and eval_const.rs](https://github.com/nushell/nushell/pull/11192) - - [Fix highlighting of spread subexpressions in records](https://github.com/nushell/nushell/pull/11202) -- [zhiburt](https://github.com/zhiburt) created - - [Fix #11047](https://github.com/nushell/nushell/pull/11054) - - [nu-table/ Add `-t/theme` argument && Replace `-n/start-number` with `-i/index`](https://github.com/nushell/nushell/pull/11058) - -## Extension -- [glcraft](https://github.com/glcraft) created - - [Syntax highlight: add "export" to "module"](https://github.com/nushell/vscode-nushell-lang/pull/166) - - [Improve type parsing in function def](https://github.com/nushell/vscode-nushell-lang/pull/167) - - [Textmate improvements](https://github.com/nushell/vscode-nushell-lang/pull/168) - - [Textmate: improvement on record entries and closure](https://github.com/nushell/vscode-nushell-lang/pull/169) - -## Documentation -- [132ikl](https://github.com/132ikl) created - - [Add a snippet to suggest using the ? operator for environmental variables](https://github.com/nushell/nushell.github.io/pull/1142) -- [amtoine](https://github.com/amtoine) created - - [Release notes for `0.87.0`](https://github.com/nushell/nushell.github.io/pull/1114) -- [app/dependabot](https://github.com/app/dependabot) created - - [Bump vite from 4.4.9 to 4.4.12](https://github.com/nushell/nushell.github.io/pull/1165) -- [app/github-actions](https://github.com/app/github-actions) created - - [Compressed Images](https://github.com/nushell/nushell.github.io/pull/1147) -- [arnau](https://github.com/arnau) created - - [Add a cookbook comparing jq and nushell](https://github.com/nushell/nushell.github.io/pull/1150) - - [Unifies all cookbook codeblocks to use the same style.](https://github.com/nushell/nushell.github.io/pull/1151) - - [Rename def-env to def --env](https://github.com/nushell/nushell.github.io/pull/1155) -- [CAESIUS-TIM](https://github.com/CAESIUS-TIM) created - - [:memo: Replace `decimal` with `float`](https://github.com/nushell/nushell.github.io/pull/1161) - - [[zh-CN] Update README, and Getting Started (入门篇)](https://github.com/nushell/nushell.github.io/pull/1168) -- [FMotalleb](https://github.com/FMotalleb) created - - [Update coming_from_bash.md](https://github.com/nushell/nushell.github.io/pull/1158) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [Fix jq comparison](https://github.com/nushell/nushell.github.io/pull/1162) -- [hustcer](https://github.com/hustcer) created - - [Refresh command docs for Nu v0.87](https://github.com/nushell/nushell.github.io/pull/1144) -- [KAAtheWiseGit](https://github.com/KAAtheWiseGit) created - - [Fix append to mutable variable operator](https://github.com/nushell/nushell.github.io/pull/1164) -- [Ktoks](https://github.com/Ktoks) created - - [Update creating_errors.md](https://github.com/nushell/nushell.github.io/pull/1154) -- [MarikaChlebowska](https://github.com/MarikaChlebowska) created - - [Replace usage of removed `date format` with `format date` in examples](https://github.com/nushell/nushell.github.io/pull/1157) -- [ppenguin](https://github.com/ppenguin) created - - [Add `parse` examples to *Parsing*](https://github.com/nushell/nushell.github.io/pull/1152) -- [sholderbach](https://github.com/sholderbach) created - - [Clean up contributor book](https://github.com/nushell/nushell.github.io/pull/1153) -- [sophiajt](https://github.com/sophiajt) created - - [Add 2023 survey results](https://github.com/nushell/nushell.github.io/pull/1143) -- [stfacc](https://github.com/stfacc) created - - [Improve workaround for carapace ERR output](https://github.com/nushell/nushell.github.io/pull/1159) -- [ysthakur](https://github.com/ysthakur) created - - [Add section on spread operator](https://github.com/nushell/nushell.github.io/pull/1160) - -## Nu_Scripts -- [Abdillah](https://github.com/Abdillah) created - - [completions/git: fix support for path relative to current directory](https://github.com/nushell/nu_scripts/pull/666) -- [amtoine](https://github.com/amtoine) created - - [add a "bulk rename" command to the stdlib candidates](https://github.com/nushell/nu_scripts/pull/643) - - [add missing tasks to the release note PR](https://github.com/nushell/nu_scripts/pull/665) - - [add `clip` from standard library](https://github.com/nushell/nu_scripts/pull/674) -- [AucaCoyan](https://github.com/AucaCoyan) created - - [:sparkles: Add `rustup` completions](https://github.com/nushell/nu_scripts/pull/689) - - [Add rustup completions](https://github.com/nushell/nu_scripts/pull/690) - - [:sparkles: Add `pnpm` completions](https://github.com/nushell/nu_scripts/pull/692) -- [drbrain](https://github.com/drbrain) created - - [Improve git branch cleanup script](https://github.com/nushell/nu_scripts/pull/685) -- [Euphrasiologist](https://github.com/Euphrasiologist) created - - [Create basic-git.nu](https://github.com/nushell/nu_scripts/pull/687) - - [Adding the `A` case](https://github.com/nushell/nu_scripts/pull/688) -- [fj0r](https://github.com/fj0r) created - - [cwdhist: can place the path anywhere in the buffer](https://github.com/nushell/nu_scripts/pull/669) - - [rename `cmd parse` to `argx` to improve importing](https://github.com/nushell/nu_scripts/pull/671) - - [nu-complete kube deploys and pods](https://github.com/nushell/nu_scripts/pull/682) - - [generate completions from tree-shaped data](https://github.com/nushell/nu_scripts/pull/683) - - [container-create -w: mount $env.PWD as workdir](https://github.com/nushell/nu_scripts/pull/686) -- [fnuttens](https://github.com/fnuttens) created - - [Add bat aliases](https://github.com/nushell/nu_scripts/pull/678) -- [glcraft](https://github.com/glcraft) created - - [Add `record` module](https://github.com/nushell/nu_scripts/pull/679) -- [kjelly](https://github.com/kjelly) created - - [get deploy complete for ka/kl in kubernetes module](https://github.com/nushell/nu_scripts/pull/680) -- [RGBCube](https://github.com/RGBCube) created - - [Fix typo in bat aliases](https://github.com/nushell/nu_scripts/pull/684) -- [sholderbach](https://github.com/sholderbach) created - - [Change uses of `size` to `str stats`](https://github.com/nushell/nu_scripts/pull/647) - - [Change `nu-deps` script to not care about waves](https://github.com/nushell/nu_scripts/pull/667) - - [Update `nu_release.nu` for 0.87 release](https://github.com/nushell/nu_scripts/pull/668) -- [WindSoilder](https://github.com/WindSoilder) created - - [remove null-stream](https://github.com/nushell/nu_scripts/pull/670) - - [Using def --env instead of def-env](https://github.com/nushell/nu_scripts/pull/673) - -## Reedline -- [ClementNerma](https://github.com/ClementNerma) created - - [Allow to construct ReedlineError values from the outside](https://github.com/nushell/reedline/pull/676) - - [Allow to build HistoryItemId values from the outside](https://github.com/nushell/reedline/pull/677) - - [ Make history-related items (de-)serializable](https://github.com/nushell/reedline/pull/678) -- [crides](https://github.com/crides) created - - [vi mode: map `cw`/`cW` to `ce`/`cE` by default](https://github.com/nushell/reedline/pull/668) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [Also run clippy on examples](https://github.com/nushell/reedline/pull/666) -- [sholderbach](https://github.com/sholderbach) created - - [Properly handle optional event modes](https://github.com/nushell/reedline/pull/659) - - [Bump version for `0.26.0` release](https://github.com/nushell/reedline/pull/664) - - [Build docs.rs docs with all features](https://github.com/nushell/reedline/pull/672) diff --git a/blog/2024-01-09-nushell_0_89_0.md b/blog/2024-01-09-nushell_0_89_0.md deleted file mode 100644 index 21bfd2f680d..00000000000 --- a/blog/2024-01-09-nushell_0_89_0.md +++ /dev/null @@ -1,444 +0,0 @@ ---- -title: Nushell 0.89.0 -author: The Nu Authors -author_site: https://twitter.com/nu_shell -author_image: https://www.nushell.sh/blog/images/nu_logo.png -excerpt: Today, we're releasing version 0.89.0 of Nu. This release adds spreading of argument lists to command calls, better editor integration, and many bugfixes. ---- - - -# Nushell 0.89.0 - -Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines. - - -Today, we're releasing version 0.89.0 of Nu. This release adds spreading of argument lists to command calls, better editor integration, and many bugfixes. - -# Where to get it - -Nu 0.89.0 is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/0.89.0) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`. - -::: tip Note -The optional dataframe functionality is available by `cargo install nu --features=dataframe`. -::: - -As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_`. - -# Table of content -- [Nushell 0.89.0](#nushell-0890) -- [Where to get it](#where-to-get-it) -- [Table of content](#table-of-content) -- [Themes of this release / New features \[toc\]](#themes-of-this-release--new-features-toc) - - [Removal of directory module auto-exports](#update-19012024-breaking-change-removal-of-directory-module-auto-exports-toc) - - [Spread operator for commands](#spread-operator-for-commands) - - [Editor Improvements](#editor-improvements) - - [Deprecation of `--flag: bool`](#deprecation-of---flag-bool) - - [Our set of commands is evolving \[toc\]](#our-set-of-commands-is-evolving-toc) - - [New commands \[toc\]](#new-commands-toc) - - [`ulimit` for Unix-based systems](#ulimit-for-unix-based-systems) -- [Breaking changes \[toc\]](#breaking-changes-toc) -- [Full changelog \[toc\]](#full-changelog-toc) - - [Nushell](#nushell) - - [Documentation](#documentation) - - [Nu\_Scripts](#nu_scripts) - - [Reedline](#reedline) - -- [*Breaking changes*](#breaking-changes-toc) -- [*Full changelog*](#full-changelog-toc) - -# Themes of this release / New features [[toc](#table-of-content)] - - - -## (Update 19.01.2024, Breaking change!) Removal of directory module auto-exports [[toc](#table-of-content)] - -_Release note gremlin hid this note from us and we forgot to add it. We're sorry!_ - -[@amtoine](https://github.com/amtoine) in [#11157](https://github.com/nushell/nushell/pull/11157) removed the directory module autoexport of all .nu files inside the directory. This removes the ability to "dump .nu files into a directory" and have them automatically exported. Previously, if you had the following file structure: - -``` -spam -├── bar.nu -├── baz.nu -├── foo.nu -└── mod.nu -``` -all you had to do was to call `use spam` and the `.nu` files would be added as submodules of `spam`. Now, to achieve the same effect, you would need to put -```nushell -export module foo.nu -export module bar.nu -export module baz.nu -``` -to the `mod.nu`. - -This change adds one manual step you need to perform to export submodules from modules, but it gives you more control and confidence. In the previous system, .nu files would be auto-exported _even if you didn't want to_! For example, to prevent `baz.nu` from being auto-exported, you would need to put it inside a new directory that doesn't contain `mod.nu` (and thus is not considered a Nushell module), like this: -``` -spam -├── bar.nu -├── foo.nu -└── utils - └── baz.nu -``` -We felt like this workaround was quite cumbersome, and the implicit behavior wasn't in the disciplined spirit of Nushell. Rather than having this auto-exporting as an _implicit_ feature of `use`, we're currently exploring ways to allow doing it _explicitly_, for example with a separate command. - -## Spread operator for commands - -In [#11289](https://github.com/nushell/nushell/pull/11289), [@ysthakur](https://github.com/ysthakur/) -implemented a spread operator for calling commands (previously, it could only be used in list and record literals). - -Now, if you have a command with a rest parameter: - -```nushell -def foo [ ...args ] { $args | to nuon } -``` - -You can spread arguments to it like this: - -```nushell -> let x = [foo bar baz] -> foo ...[1 2] ...$x -[1, 2, foo, bar, baz] -``` - -See [the docs](/book/operators.html#spread-operator) for more information. - -## Editor Improvements - -Thanks to @AucaCoyan's [#11284](https://github.com/nushell/nushell/pull/11284) and [#11320](https://github.com/nushell/nushell/pull/11320), Nushell's VSCode extension and builtin LSP server now show the same command's message on hover as abtained with `help` in Nushell. - -## Deprecation of `--flag: bool` - -In the last release, we allowed passing flags dynamically: -```nushell -def spam [--foo] { - print $foo -} - -let value = false -spam --foo=$value -# prints false -``` -However, it is easy to confuse with `--foo: bool`. To disambiguate, we are deprecating the setting optional parameters with boolean type (`--flag: bool`). Doing so will trigger a warning: -```nushell -def spam [--foo: bool] { $foo } -Error: × Deprecated: --flag: bool - ╭─[entry #3:1:1] - 1 │ def spam [--foo: bool] { $foo } - · ──┬─ - · ╰── `--flag: bool` is deprecated and will be removed in 0.90. Please use `--flag` instead, more info: https://www.nushell.sh/book/custom_commands.html - ╰──── -``` - -## Our set of commands is evolving [[toc](#table-of-content)] -As usual, new release rhyms with changes to commands! - -### New commands [[toc](#table-of-content)] - -#### `ulimit` for Unix-based systems - -The new `ulimit` command added by [@nibon7](https://github.com/nushell/nushell/pull/11324) can now be used on Unix-based systems for setting or checking the resource limits, such as the stack size or virtual memory size, for the current user. - -To list the currrent limits: -```nushell -ulimit -a -``` - -Setting the limits is done via flags available in `help ulimit`. - - - -# Breaking changes [[toc](#table-of-content)] - - -- [#11131](https://github.com/nushell/nushell/pull/11131) remove `std clip` -- [#11414](https://github.com/nushell/nushell/pull/11414) Lock out new direct construction of `Record` -- [#11367](https://github.com/nushell/nushell/pull/11367) Remove `Expr::MatchPattern` -- [#11355](https://github.com/nushell/nushell/pull/11355) Rename extra's `format` to `format pattern` -- [#11356](https://github.com/nushell/nushell/pull/11356) Remove `Value::MatchPattern` -- [#11313](https://github.com/nushell/nushell/pull/11313) Bubble up errors passed to `complete` -- [#11157](https://github.com/nushell/nushell/pull/11157) disable directory submodule auto export - - -# Full changelog [[toc](#table-of-content)] - - -## Nushell -- [amtoine](https://github.com/amtoine) created - - [remove `std clip`](https://github.com/nushell/nushell/pull/11131) - - [improve completions of `use` and `overlay use`](https://github.com/nushell/nushell/pull/11330) - - [disable directory submodule auto export](https://github.com/nushell/nushell/pull/11157) -- [abusch](https://github.com/abusch) created - - [fix: closure captures can also be constants](https://github.com/nushell/nushell/pull/11493) -- [WindSoilder](https://github.com/WindSoilder) created - - [update reedline version to latest main](https://github.com/nushell/nushell/pull/11490) - - [Deprecate `--flag: bool` in custom command](https://github.com/nushell/nushell/pull/11365) - - [enable flag value type checking](https://github.com/nushell/nushell/pull/11311) - - [Fix piping output logic](https://github.com/nushell/nushell/pull/11317) -- [NotLebedev](https://github.com/NotLebedev) created - - [Xml errors fix](https://github.com/nushell/nushell/pull/11487) -- [nibon7](https://github.com/nibon7) created - - [Bump terminal_size to 0.3](https://github.com/nushell/nushell/pull/11486) - - [Fix cross building for target x86_64-pc-windows-gnu on linux](https://github.com/nushell/nushell/pull/11485) - - [Bump sysinfo from 0.29 to 0.30](https://github.com/nushell/nushell/pull/11484) - - [Replace `winapi` with `windows`](https://github.com/nushell/nushell/pull/11481) - - [Don't panic when `http_client` fails](https://github.com/nushell/nushell/pull/11422) - - [Don't create a thread if stderr_stream is None](https://github.com/nushell/nushell/pull/11421) - - [Fix an infinite loop if the input stream and output stream are the same](https://github.com/nushell/nushell/pull/11384) - - [Bump windows from 0.48.0 to 0.52.0 ](https://github.com/nushell/nushell/pull/11325) - - [Fix build for BSDs](https://github.com/nushell/nushell/pull/11372) - - [Allow `filesize` type as a valid limit value](https://github.com/nushell/nushell/pull/11349) - - [Allow `int` type as a valid limit value](https://github.com/nushell/nushell/pull/11346) - - [Add ulimit command](https://github.com/nushell/nushell/pull/11324) -- [yukitomoda](https://github.com/yukitomoda) created - - [Refactor tests (using cococo instead of ^echo)](https://github.com/nushell/nushell/pull/11479) - - [Fix the test which fails on windows](https://github.com/nushell/nushell/pull/11478) - - [Fix rm for symlinks pointing to directory on windows (issue #11461)](https://github.com/nushell/nushell/pull/11463) -- [hustcer](https://github.com/hustcer) created - - [Try to fix riscv64 building by using unbuntu-latest](https://github.com/nushell/nushell/pull/11476) - - [Downgrade openssl-src to fix riscv64 build target, close #11345](https://github.com/nushell/nushell/pull/11353) -- [rsteube](https://github.com/rsteube) created - - [Revert "Return external file completions if not empty (#10898)"](https://github.com/nushell/nushell/pull/11446) -- [fdncred](https://github.com/fdncred) created - - [bump rust toolchain to 1.73.0](https://github.com/nushell/nushell/pull/11445) - - [Revert "Bump reedline development version"](https://github.com/nushell/nushell/pull/11425) - - [add special emoji handling for debug --raw](https://github.com/nushell/nushell/pull/11368) - - [Revert "Only run $env.PROMPT_COMMAND once per prompt"](https://github.com/nushell/nushell/pull/11340) - - [update reedline to latest + include PR 675 for testing](https://github.com/nushell/nushell/pull/11339) -- [ysthakur](https://github.com/ysthakur) created - - [Allow spreading arguments to commands](https://github.com/nushell/nushell/pull/11289) - - [More specific errors for missing values in records](https://github.com/nushell/nushell/pull/11423) - - [Only run $env.PROMPT_COMMAND once per prompt (copy of #10986)](https://github.com/nushell/nushell/pull/11366) - - [Don't redraw prompt when transient prompt disabled](https://github.com/nushell/nushell/pull/10788) -- [cyradotpink](https://github.com/cyradotpink) created - - [Allow `http` commands' automatic redirect-following to be disabled](https://github.com/nushell/nushell/pull/11329) -- [SebastianIonel](https://github.com/SebastianIonel) created - - [Fix the bug for "bytes remove --end" .](https://github.com/nushell/nushell/pull/11428) -- [IanManske](https://github.com/IanManske) created - - [Remove unnecessary `replace_in_variable`](https://github.com/nushell/nushell/pull/11424) - - [Simplify `SIGQUIT` handling](https://github.com/nushell/nushell/pull/11381) - - [Make `Call::get_flag_expr` return `&Expression` instead of owned value ](https://github.com/nushell/nushell/pull/11388) - - [Remove `Expr::MatchPattern`](https://github.com/nushell/nushell/pull/11367) - - [Refactor `group-by` with closure grouper](https://github.com/nushell/nushell/pull/11370) - - [Remove `Value::MatchPattern`](https://github.com/nushell/nushell/pull/11356) - - [Satisfy clippy lint in benchmark](https://github.com/nushell/nushell/pull/11350) -- [sholderbach](https://github.com/sholderbach) created - - [Simplify the feature gates for `stor` commands](https://github.com/nushell/nushell/pull/11416) - - [Make polars deps optional for `cargo test --all`](https://github.com/nushell/nushell/pull/11415) - - [Lock out new direct construction of `Record`](https://github.com/nushell/nushell/pull/11414) - - [Check for clean repo after tests](https://github.com/nushell/nushell/pull/11409) - - [Bump reedline development version](https://github.com/nushell/nushell/pull/11406) - - [Fix sandboxing of redirection tests](https://github.com/nushell/nushell/pull/11407) - - [Bump `fancy-regex` to single `0.12.0` version](https://github.com/nushell/nushell/pull/11389) - - [Construct `Record`s only through checked helpers](https://github.com/nushell/nushell/pull/11386) - - [Expand the workspace `members` in `Cargo.toml`](https://github.com/nushell/nushell/pull/11387) - - [Properly update to the reedline repo patch](https://github.com/nushell/nushell/pull/11342) - - [Bump version to `0.88.2`](https://github.com/nushell/nushell/pull/11333) - - [Bump version to `0.88.1`](https://github.com/nushell/nushell/pull/11303) - - [Revert lock file changes due to openssl build fail](https://github.com/nushell/nushell/pull/11328) - - [Bump version for `0.88.0` release](https://github.com/nushell/nushell/pull/11298) -- [lavafroth](https://github.com/lavafroth) created - - [fix: prevent greedy matching of directory names](https://github.com/nushell/nushell/pull/11403) -- [AucaCoyan](https://github.com/AucaCoyan) created - - [:memo: Update `str trim` CLI help doc](https://github.com/nushell/nushell/pull/11383) - - [:sparkles: Make `hover` equal to `help` command](https://github.com/nushell/nushell/pull/11320) - - [:recycle: Match `--ide-hover` with `help` command](https://github.com/nushell/nushell/pull/11284) -- [hardfau1t](https://github.com/hardfau1t) created - - [fix(cd): on android/termux fails to cd into /sdcard](https://github.com/nushell/nushell/pull/10329) -- [0323pin](https://github.com/0323pin) created - - [Fix build on NetBSD](https://github.com/nushell/nushell/pull/11364) -- [stormasm](https://github.com/stormasm) created - - [nu-cli repl get_command_finished_marker() does not need to be pub](https://github.com/nushell/nushell/pull/11362) -- [KAAtheWiseGit](https://github.com/KAAtheWiseGit) created - - [Rename extra's `format` to `format pattern`](https://github.com/nushell/nushell/pull/11355) - - [Bubble up errors passed to `complete`](https://github.com/nushell/nushell/pull/11313) - - [Add `format` meta command](https://github.com/nushell/nushell/pull/11334) - - [Replace bash with POSIX sh in tests](https://github.com/nushell/nushell/pull/11293) -- [crides](https://github.com/crides) created - - [fix shell integration markers](https://github.com/nushell/nushell/pull/11352) -- [CAD97](https://github.com/CAD97) created - - [Only run $env.PROMPT_COMMAND once per prompt](https://github.com/nushell/nushell/pull/10986) -- [Hofer-Julian](https://github.com/Hofer-Julian) created - - [Move history into their own module](https://github.com/nushell/nushell/pull/11308) - - [Move `stor` commands to category `Database`](https://github.com/nushell/nushell/pull/11315) -- [ayax79](https://github.com/ayax79) created - - [Polars Struct support without unsafe blocks](https://github.com/nushell/nushell/pull/11229) -- [drbrain](https://github.com/drbrain) created - - [Enforce required, optional, and rest positional arguments start with an uppercase and end with a period.](https://github.com/nushell/nushell/pull/11285) -- [AntoineSebert](https://github.com/AntoineSebert) created - - [fix-`open`-is-ambiguous](https://github.com/nushell/nushell/pull/11302) -- [sophiajt](https://github.com/sophiajt) created - - [bump reedline dep to 0.27](https://github.com/nushell/nushell/pull/11299) - -## Documentation -- [amtoine](https://github.com/amtoine) created - - [mark feature-gated commands more clearly](https://github.com/nushell/nushell.github.io/pull/1183) - - [logo contest announcement](https://github.com/nushell/nushell.github.io/pull/1180) - - [Release notes for `0.88.0`](https://github.com/nushell/nushell.github.io/pull/1146) -- [TWSiO](https://github.com/TWSiO) created - - [Adding warning to nu_plugin_formats commands](https://github.com/nushell/nushell.github.io/pull/1199) -- [yukitomoda](https://github.com/yukitomoda) created - - [JA update installation.md](https://github.com/nushell/nushell.github.io/pull/1198) - - [JA update shells_in_shells.md](https://github.com/nushell/nushell.github.io/pull/1197) - - [fix a description of usage scenario](https://github.com/nushell/nushell.github.io/pull/1196) - - [Update shells_in_shells.md](https://github.com/nushell/nushell.github.io/pull/1195) - - [update the list of commands which are interpreted by CMD](https://github.com/nushell/nushell.github.io/pull/1192) -- [hustcer](https://github.com/hustcer) created - - [Upgrade Vuepress, some Vuepress plugins and shiki syntax highlighter](https://github.com/nushell/nushell.github.io/pull/1194) - - [Refresh command docs for Nu v0.88](https://github.com/nushell/nushell.github.io/pull/1171) -- [aserowy](https://github.com/aserowy) created - - [external completer: fixed cookbook example to exchange the first span entry only](https://github.com/nushell/nushell.github.io/pull/1193) -- [YukiOnodera](https://github.com/YukiOnodera) created - - [I've revised the Japanese translation](https://github.com/nushell/nushell.github.io/pull/1179) -- [zolodev](https://github.com/zolodev) created - - [Update aliases adding new section](https://github.com/nushell/nushell.github.io/pull/1190) -- [ysthakur](https://github.com/ysthakur) created - - [Add info on spread operator in commands for 0.89 release notes](https://github.com/nushell/nushell.github.io/pull/1188) - - [Add information on spread operator](https://github.com/nushell/nushell.github.io/pull/1176) -- [frogshead](https://github.com/frogshead) created - - [fix typo](https://github.com/nushell/nushell.github.io/pull/1185) -- [Trent-Fellbootman](https://github.com/Trent-Fellbootman) created - - [Update types_of_data.md](https://github.com/nushell/nushell.github.io/pull/1184) - - [Update thinking_in_nu.md](https://github.com/nushell/nushell.github.io/pull/1172) -- [WindSoilder](https://github.com/WindSoilder) created - - [add information about switches](https://github.com/nushell/nushell.github.io/pull/1182) -- [app/github-actions](https://github.com/app/github-actions) created - - [Compressed Images](https://github.com/nushell/nushell.github.io/pull/1181) -- [MediosZ](https://github.com/MediosZ) created - - [Sync zh-CN shells_in_shells.](https://github.com/nushell/nushell.github.io/pull/1178) -- [braddunbar](https://github.com/braddunbar) created - - [Typo in history menu section](https://github.com/nushell/nushell.github.io/pull/1177) -- [IndigoLily](https://github.com/IndigoLily) created - - [Fix various spelling/grammar issues in release notes for `0.88.0`](https://github.com/nushell/nushell.github.io/pull/1175) -- [Tamnac](https://github.com/Tamnac) created - - [Add time command to nushell_map.md](https://github.com/nushell/nushell.github.io/pull/1173) -- [mb21](https://github.com/mb21) created - - [Extend globbing section in moving_around.md](https://github.com/nushell/nushell.github.io/pull/1125) -- [RGBCube](https://github.com/RGBCube) created - - [Update background_task.md](https://github.com/nushell/nushell.github.io/pull/1166) - -## Nu_Scripts -- [fj0r](https://github.com/fj0r) created - - [comma: upgrade template](https://github.com/nushell/nu_scripts/pull/725) - - [kubernetes to docker-compose](https://github.com/nushell/nu_scripts/pull/726) - - [comma test runner](https://github.com/nushell/nu_scripts/pull/715) - - [merge container-inspect into container-process-list](https://github.com/nushell/nu_scripts/pull/711) - - [comma: support filter, watch, poll](https://github.com/nushell/nu_scripts/pull/707) - - [new module comma and some updates](https://github.com/nushell/nu_scripts/pull/704) -- [bobhy](https://github.com/bobhy) created - - [Show activated python VE at beginning of prompt.](https://github.com/nushell/nu_scripts/pull/722) -- [AucaCoyan](https://github.com/AucaCoyan) created - - [:bug: fix `(default)` and `(installed)` on rustup completions](https://github.com/nushell/nu_scripts/pull/721) - - [:bug: rename `yarn` for `yarn-v4` and add `run` cmpl](https://github.com/nushell/nu_scripts/pull/720) - - [:sparkles: `code` completions](https://github.com/nushell/nu_scripts/pull/719) - - [:sparkles: add completion to `gh pr checkout `](https://github.com/nushell/nu_scripts/pull/714) - - [:sparkles: add more `gh` completions](https://github.com/nushell/nu_scripts/pull/713) - - [:sparkles: Add the first layer of depth to the cmds](https://github.com/nushell/nu_scripts/pull/708) - - [:sparkles: First `gh` completions](https://github.com/nushell/nu_scripts/pull/706) - - [:bug: Fix `rustup` use completions and modify README](https://github.com/nushell/nu_scripts/pull/696) -- [edhowland](https://github.com/edhowland) created - - [Adds Modules/recursion : Examples of Fun with Recursive functions in Nu](https://github.com/nushell/nu_scripts/pull/717) -- [frogshead](https://github.com/frogshead) created - - [fix broken links in modules readme](https://github.com/nushell/nu_scripts/pull/718) - - [fix broken link on README.md](https://github.com/nushell/nu_scripts/pull/716) -- [robbienohra](https://github.com/robbienohra) created - - [fix: missing regex flag](https://github.com/nushell/nu_scripts/pull/712) -- [adrian5](https://github.com/adrian5) created - - [Add tokyo-moon theme variant](https://github.com/nushell/nu_scripts/pull/710) -- [kjelly](https://github.com/kjelly) created - - [fix git-v2 and kubernetes](https://github.com/nushell/nu_scripts/pull/703) -- [zyfmix](https://github.com/zyfmix) created - - [Fix: nushell at 0.88.0 start and end are deprecated](https://github.com/nushell/nu_scripts/pull/698) -- [RGBCube](https://github.com/RGBCube) created - - [Rewrite and expand background task module](https://github.com/nushell/nu_scripts/pull/691) -- [TeaDrinkingProgrammer](https://github.com/TeaDrinkingProgrammer) created - - [Added updated and improved version of the conda scripts](https://github.com/nushell/nu_scripts/pull/694) - -## Reedline -- [WindSoilder](https://github.com/WindSoilder) created - - [Try fix prompt_start_row reset to 0 when opening a file without newline in Nushell ](https://github.com/nushell/reedline/pull/697) - - [fix clippy, add typo dict](https://github.com/nushell/reedline/pull/698) -- [sholderbach](https://github.com/sholderbach) created - - [Fix clippy from the future](https://github.com/nushell/reedline/pull/687) - - [Bump `itertools` to `0.12.0` from `0.10.x`](https://github.com/nushell/reedline/pull/686) - - [Bump version to 0.27.1](https://github.com/nushell/reedline/pull/683) - - [Try to fix the docs.rs build](https://github.com/nushell/reedline/pull/682) - - [Bump version for 0.27 release](https://github.com/nushell/reedline/pull/681) -- [nibon7](https://github.com/nibon7) created - - [Fix `prompt_start_row` reset to 0 when opening a file without newline in Nushell](https://github.com/nushell/reedline/pull/688) -- [danielsomerfield](https://github.com/danielsomerfield) created - - [Better behaviour on resize](https://github.com/nushell/reedline/pull/675) diff --git a/blog/README.md b/blog/README.md deleted file mode 100644 index 15f9f1b337d..00000000000 --- a/blog/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Nu Blog - -[RSS](/rss.xml) / [Atom](/atom.xml) - - diff --git a/book/cheat_sheet.md b/book/cheat_sheet.md deleted file mode 100644 index def5666f897..00000000000 --- a/book/cheat_sheet.md +++ /dev/null @@ -1,549 +0,0 @@ -# Nushell cheat sheet - -## Data types - -```nu - > "12" | into int -``` - -> **converts string to integer** - ---- - -```nu - > date now | date to-timezone "Europe/London" -``` - -> **converts present date to provided time zone** - ---- - -```nu - > {'name': 'nu', 'stars': 5, 'language': 'Python'} | upsert language 'Rust' -``` - -> **updates a record's language and if none is specified inserts provided value** - ---- - -```nu - > [one two three] | to yaml -``` - -> **converts list of strings to yaml** - ---- - -```nu - > [[framework, language]; [Django, Python] [Lavarel, PHP]] -``` - -> **prints the table** - ---- - -```nu - > [{name: 'Robert' age: 34 position: 'Designer'} - {name: 'Margaret' age: 30 position: 'Software Developer'} - {name: 'Natalie' age: 50 position: 'Accountant'} - ] | select name position -``` - -> **selects two columns from the table and prints their values** - -## Strings - -```nu - > let name = "Alice" - > $"greetings, ($name)!" -``` - -> **prints `greetings, Alice!`** - ---- - -```nu - > let string_list = "one,two,three" | split row "," - $string_list - - ╭───┬───────╮ - │ 0 │ one │ - │ 1 │ two │ - │ 2 │ three │ - ╰───┴───────╯ -``` - -> **splits the string with specified delimiter and saves the list to `string_list` variable** - ---- - -```nu - "Hello, world!" | str contains "o, w" -``` - -> **checks if a string contains a substring and returns `boolean`** - ---- - -```nu - let str_list = [zero one two] - $str_list | str join ',' -``` - -> **joins the list of strings using provided delimiter** - ---- - -```nu - > 'Hello World!' | str substring 4..8 -``` - -> **created a slice from a given string with start (4) and end (8) indices** - ---- - -```nu - > 'Nushell 0.80' | parse '{shell} {version}' - - ╭───┬─────────┬─────────╮ - │ # │ shell │ version │ - ├───┼─────────┼─────────┤ - │ 0 │ Nushell │ 0.80 │ - ╰───┴─────────┴─────────╯ -``` - -> **parses the string to columns** - -```nu - > "acronym,long\nAPL,A Programming Language" | from csv -``` - -> **parses comma separated values (csv)** - -```nu - > $'(ansi purple_bold)This text is a bold purple!(ansi reset)' -``` - -> **ansi command colors the text (alsways end with `ansi reset` to reset color to default)** - -## Lists - -```nu - > [foo bar baz] | insert 1 'beeze' - - ╭───┬───────╮ - │ 0 │ foo │ - │ 1 │ beeze │ - │ 2 │ bar │ - │ 3 │ baz │ - ╰───┴───────╯ -``` - -> **inserts `beeze` value at st index in the list** - ---- - -```nu - > [1, 2, 3, 4] | update 1 10 -``` - -> **updates 2nd value to 10** - ---- - -```nu - > let numbers = [1, 2, 3, 4, 5] - > $numbers | prepend 0 -``` - -> **adds value at the beginning of the list** - ---- - -```nu - > let numbers = [1, 2, 3, 4, 5] - > $numbers | append 6 -``` - -> **adds value at the end of the list** - ---- - -```nu - > let flowers = [cammomile marigold rose forget-me-not] - > let flowers = ($flowers | first 2) - > $flowers -``` - -> **creates slice of first two values from `flowers` list** - ---- - -```nu - > let planets = [Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune] - > $planets | each { |it| $"($it) is a planet of solar system" } -``` - -> **iterates over a list; `it` is current list value** - ---- - -```nu - > $planets | enumerate | each { |it| $"($it.index + 1) - ($it.item)" } -``` - -> **iterates over a list and provides index and value in `it`** - ---- - -```nu - > let scores = [3 8 4] - > $"total = ($scores | reduce { |it, acc| $acc + $it })" -``` - -> **reduces the list to a single value, `reduce` gives access to accumulator that is applied -> to each element in the list** - ---- - -```nu - > $"total = ($scores | reduce --fold 1 { |it, acc| $acc * $it })" -``` - -> **initial value for accumulator value can be set with `--fold`** - ---- - -```nu - > let planets = [Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune] - > $planets.2 - > Earth -``` - -> **gives access to the 3rd item in the list** - ---- - -```nu - > let planets = [Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune] - > $planets | any {|it| $it | str starts-with "E" } - > true -``` - -> **checks if any string in the list starts with `E`** - ---- - -```nu - > let cond = {|x| $x < 0 }; [-1 -2 9 1] | take while $cond - ╭───┬────╮ - │ 0 │ -1 │ - │ 1 │ -2 │ - ╰───┴────╯ -``` - -> **creates slice of items that satisfy provided condition** - -## Tables - -```nu - > ls | sort-by size -``` - -> **sorting table by size of files** - ---- - -```nu - > ls | sort-by size | first 5 -``` - -> **sorting table by size of files and show first 5 entries** - ---- - -```nu - > let $a = [[first_column second_column third_column]; [foo bar snooze]] - > let $b = [[first_column second_column third_column]; [hex seeze feeze]] - > $a | append $b - - ╭───┬──────────────┬───────────────┬──────────────╮ - │ # │ first_column │ second_column │ third_column │ - ├───┼──────────────┼───────────────┼──────────────┤ - │ 0 │ foo │ bar │ snooze │ - │ 1 │ hex │ seeze │ feeze │ - ╰───┴──────────────┴───────────────┴──────────────╯ -``` - -> **concatenate two tables with same columns** - ---- - -```nu - > let teams_scores = [[team score plays]; ['Boston Celtics' 311 3] ['Golden State Warriors', 245 2]] - > $teams_scores | drop column - - ╭───┬───────────────────────┬───────╮ - │ # │ team │ score │ - ├───┼───────────────────────┼───────┤ - │ 0 │ Boston Celtics │ 311 │ - │ 1 │ Golden State Warriors │ 245 │ - ╰───┴───────────────────────┴───────╯ -``` - -> **remove the last column of a table** - -## Files & Filesystem - -```nu - > start file.txt -``` - -> **opens a text file with the default text editor** - ---- - -```nu - > 'lorem ipsum ' | save file.txt -``` - -> **saves a string to text file** - ---- - -```nu - > 'dolor sit amet' | save --append file.txt -``` - -> **appends a string to the end of file.txt** - ---- - -```nu - > { a: 1, b: 2 } | save file.json -``` - -> **saves a record to file.json** - ---- - -```nu - > glob **/*.{rs,toml} --depth 2 -``` - -> **searches for `.rs` and `.toml` files recursively up to 2 folders deep** - ---- - -```nu - > watch . --glob=**/*.rs {|| cargo test } -``` - -> **runs cargo test whenever a Rust file changes** - ---- - -## Custom Commands - -```nu - def greet [name: string] { - $"hello ($name­)" - } -``` - -> **custom command with parameter type set to string** - ---- - -```nu - def greet [name = "nushell"] { - $"hello ($name­)" - } -``` - -> **custom command with default parameter set to nushell** - ---- - -```nu - def greet [ - name: string - --age: int - ] { - [$name $age] - } - - > greet world --age 10 -``` - -> **passing named parameter by defining flag for custom commands** - ---- - -```nu - def greet [ - name: string - --age (-a): int - --twice - ] { - if $twice { - [$name $age $name $age] - } else { - [$name $age] - } - } - > greet -a 10 --twice hello -``` - -> **using flag as a switch with a shorthand flag (-a) for the age** - ---- - -```nu - def greet [...name: string] { - print "­hello all:" - for $n in $name { - print $n - } - } - - > greet earth mars jupiter venus -``` - -> **custom command which takes any number of positional arguments using rest params** - -## Variables & Subexpressions - -```nu - > let val = 42 - > print $val - 42 -``` - -> **an immutable variable cannot change its value after declaration** - ---- - -```nu - > let val = 42 - > do { let val = 101; $val } - 101 - > $val - 42 -``` - -> **shadowing variable (declaring variable with the same name in a different scope)** - ---- - -```nu - > mut val = 42 - > $val += 27 - > $val - 69 -``` - -> **declaring a mutable variable with mut key word** - ---- - -```nu - > mut x = 0 - > [1 2 3] | each { $x += 1 } -``` - -> **closures and nested defs cannot capture mutable variables from their enviro­nment. -> This expression results in error.** - -```nu - > const plugin = 'path/­to/­plugin' - > register $plugin -``` - -> **a constant variable is immutable value which is fully evaluated at parse-time** - ---- - -```nu - > let files = (ls) - > $files.na­me?.0? -``` - -> **using question mark operator to return null instead of error if provided path is incorrect** - ---- - -```nu - > let big_files = (ls | where size > 10kb) - > $big_files -``` - -> **using subexp­ression by wrapping the expression with parent­heses ()** - ---- - -## Modules - -```nu - > module greetings { - export def hello [name: string] { - $"hello ($name­)!" - } - - export def hi [where: string] { - $"hi ($where)!­" - } - } - - > use greetings hello - > hello "­wor­ld" -``` - -> **using inline module** - ---- - -```nu - # greeti­ngs.nu - export-env { - $env.M­YNAME = "­Arthur, King of the Briton­s" - } - export def hello [] { - $"hello ($env.M­YN­AME­)" - } - - > use greeti­ngs.nu - > $env.M­YNAME - Arthur, King of the Britons - > greetings hello - hello Arthur, King of the Britons! -``` - -> **importing module from file and using its enviro­nment in current scope** - ---- - -```nu - # greeti­ngs.nu - export def hello [name: string] { - $"hello ($name­)!" - } - - export def hi [where: string] { - $"hi ($where)!­" - } - - export def main [] { - "­gre­etings and salutations!" - } - - > use greeti­ngs.nu - > greetings - greetings and saluta­tions! - > greetings hello world - hello world! -``` - -> **using main command in module** - ---- diff --git a/book/coming_to_nu.md b/book/coming_to_nu.md deleted file mode 100644 index 047b967cb31..00000000000 --- a/book/coming_to_nu.md +++ /dev/null @@ -1,9 +0,0 @@ -# Coming to Nu - -If you are familiar with other shells or programming languages, you might find this chapter useful to get up to speed. - -[Coming from Bash](coming_from_bash.md) shows how some patterns typical for Bash, or POSIX shells in general, can be mapped to Nushell. -Similarly, [Coming from CMD.EXE](coming_from_cmd.md) shows how built-in commands in the Windows Command Prompt can be mapped to Nushell. - -Similar comparisons are made for some [other shells and domain-specific languages](nushell_map.md), [imperative languages](nushell_map_imperative.md), and [functional languages](nushell_map_functional.md). -A separate comparison is made specifically for [operators](nushell_operator_map.md). diff --git a/book/control_flow.md b/book/control_flow.md deleted file mode 100644 index 23c62c77b9c..00000000000 --- a/book/control_flow.md +++ /dev/null @@ -1,361 +0,0 @@ -# Control Flow - -Nushell provides several commands that help determine how different groups of code are executed. In programming languages this functionality is often referred to as _control flow_. - -::: tip -One thing to note is that all of the commands discussed on this page use [blocks](/book/types_of_data.html#blocks). This means you can mutate [environmental variables](/book/environment.html) and other [mutable variables](http://localhost:8080/book/variables_and_subexpressions.html#mutable-variables) in them. -::: - -## Already covered - -Below we cover some commands related to control flow, but before we get to them, it's worthwhile to note there are several pieces of functionality and concepts that have already been covered in other sections that are also related to control flow or that can be used in the same situations. These include: - -- Pipes on the [pipelines](/book/pipelines.html) page. -- Closures on the [types of data](/book/types_of_data.html) page. -- Iteration commands on the [working with lists](/book/working_with_lists.html) page. Such as: - - [`each`](/commands/docs/each.html) - - [`where`](/commands/docs/where.html) - - [`reduce`](/commands/docs/reduce.html) - -## Choice (Conditionals) - -The following commands execute code based on some given condition. - -::: tip -The choice/conditional commands are expressions so they return values, unlike the other commands on this page. This means the following works. - -```nu -> 'foo' | if $in == 'foo' { 1 } else { 0 } | $in + 2 -3 -``` - -::: - -### `if` - -[`if`](/commands/docs/if.html) evaluates branching [blocks](/book/types_of_data.html#blocks) of code based on the results of one or more conditions similar to the "if" functionality in other programming languages. For example: - -```nu -> if $x > 0 { 'positive' } -``` - -Returns `'positive`' when the condition is `true` (`$x` is greater than zero) and `null` when the condition is `false` (`$x` is less than or equal to zero). - -We can add an `else` branch to the `if` after the first block which executes and returns the resulting value from the `else` block when the condition is `false`. For example: - -```nu -> if $x > 0 { 'positive' } else { 'non-positive' } -``` - -This time it returns `'positive'` when the condition is `true` (`$x` is greater than zero) and `'non-positive`' when the condition is `false` (`$x` is less than or equal to zero). - -We can also chain multiple `if`s together like the following: - -```nu -> if $x > 0 { 'positive' } else if $x == 0 { 'zero' } else { "negative" } -``` - -When the first condition is `true` (`$x` is greater than zero) it will return `'positive'`, when the first condition is `false` and the next condition is `true` (`$x` equals zero) it will return `'zero'`, otherwise it will return `'negative'` (when `$x` is less than zero). - -### `match` - -[`match`](/commands/docs/match.html) executes one of several conditional branches based on the value given to match. You can also do some [pattern matching](/cookbook/pattern_matching.html) to unpack values in composite types like lists and records. - -Basic usage of [`match`](/commands/docs/match.html) can conditionally run different code like a "switch" statement common in other languages. [`match`](/commands/docs/match.html) checks if the value after the word [`match`](/commands/docs/match.html) is equal to the value at the start of each branch before the `=>` and if it does, it executes the code after that branch's `=>`. - -```nu -> match 3 { - 1 => 'one', - 2 => { - let w = 'w' - 't' + $w + 'o' - }, - 3 => 'three', - 4 => 'four' -} -three -``` - -The branches can either return a single value or, as shown in the second branch, can return the results of a [block](/book/types_of_data.html#blocks). - -#### Catch all branch - -You can have also have a catch all condition for if the given value doesn't match any of the other conditions by having a branch whose matching value is `_`. - -```nu -> let foo = match 7 { - 1 => 'one', - 2 => 'two', - 3 => 'three', - _ => 'other number' -} -> $foo -other number -``` - -(Reminder, [`match`](/commands/docs/match.html) is an expression which is why we can assign the result to `$foo` here). - -#### Pattern Matching - -You can "unpack" values from types like lists and records with [pattern matching](/cookbook/pattern_matching.html). You can then assign variables to the parts you want to unpack and use them in the matched expressions. - -```nu -> let foo = { name: 'bar', count: 7 } -> match $foo { - { name: 'bar', count: $it } => ($it + 3), - { name: _, count: $it } => ($it + 7), - _ => 1 -} -10 -``` - -The `_` in the second branch means it matches any record with field `name` and `count`, not just ones where `name` is `'bar'`. - -#### Guards - -You can also add an additional condition to each branch called a "guard" to determine if the branch should be matched. To do so, after the matched pattern put `if` and then the condition before the `=>`. - -```nu -> let foo = { name: 'bar', count: 7 } -> match $foo { - { name: 'bar', count: $it } if $it < 5 => ($it + 3), - { name: 'bar', count: $it } if $it >= 5 => ($it + 7), - _ => 1 -} -14 -``` - ---- - -You can find more details about [`match`](/commands/docs/match.html) in the [pattern matching cookbook page](https://www.nushell.sh/cookbook/pattern_matching.html). - -## Loops - -The loop commands allow you to repeat a block of code multiple times. - -### Loops and other iterating commands - -The functionality of the loop commands is similar to commands that apply a closure over elements in a list or table like [`each`](/commands/docs/each.html) or [`where`](/commands/docs/where.html) and many times you can accomplish the same thing with either. For example: - -```nu -> mut result = [] -> for $it in [1 2 3] { $result = ($result | append ($it + 1)) } -> $result -╭───┬───╮ -│ 0 │ 2 │ -│ 1 │ 3 │ -│ 2 │ 4 │ -╰───┴───╯ - - -> [1 2 3] | each { $in + 1 } -╭───┬───╮ -│ 0 │ 2 │ -│ 1 │ 3 │ -│ 2 │ 4 │ -╰───┴───╯ -``` - -While it may be tempting to use loops if you're familiar with them in other languages, it is considered more in the [Nushell-style](book/thinking_in_nu.html) (idiomatic) to use commands that apply closures when you can solve a problem either way. The reason for this is because of a pretty big downside with using loops. - -#### Loop disadvantages - -The biggest downside of loops is that they are statements, unlike [`each`](/commands/docs/each.html) which is an expression. Expressions, like [`each`](/commands/docs/each.html) always result in some output value, however statements do not. - -This means that they don't work well with immutable variables and using immutable variables is considered a more [Nushell-style](/book/thinking_in_nu.html#variables-are-immutable). Without a mutable variable declared beforehand in the example in the previous section, it would be impossible to use [`for`](/commands/docs/each.html) to get the list of numbers with incremented numbers, or any value at all. - -Statements also don't work in Nushell pipelines which require some output. In fact Nushell will give an error if you try: - -```nu -> [1 2 3] | for x in $in { $x + 1 } | $in ++ [5 6 7] -Error: nu::parser::unexpected_keyword - - × Statement used in pipeline. - ╭─[entry #5:1:1] - 1 │ [1 2 3] | for x in $in { $x + 1 } | $in ++ [5 6 7] - · ─┬─ - · ╰── not allowed in pipeline - ╰──── - help: 'for' keyword is not allowed in pipeline. Use 'for' by itself, outside of a pipeline. -``` - -Because Nushell is very pipeline oriented, this means using expression commands like [`each`](/commands/docs/each.html) is typically more natural than loop statements. - -#### Loop advantages - -If loops have such a big disadvantage, why do they exist? Well, one reason is that closures, like [`each`](/commands/docs/each.html) uses, can't modify mutable variables in the surrounding environment. If you try to modify a mutable variable in a closure you will get an error: - -```nu -> mut foo = [] -> [1 2 3] | each { $foo = ($foo | append ($in + 1)) } -Error: nu::parser::expected_keyword - - × Capture of mutable variable. - ╭─[entry #8:1:1] - 1 │ [1 2 3] | each { $foo = ($foo | append ($in + 1)) } - · ──┬─ - · ╰── capture of mutable variable - ╰──── -``` - -If you modify an environmental variable in a closure, you can, but it will only modify it within the scope of the closure, leaving it unchanged everywhere else. Loops, however, use [blocks](/book/types_of_data.html#blocks) which means they can modify a regular mutable variable or an environmental variable within the larger scope. - -```nu -> mut result = [] -> for $it in [1 2 3] { $result = ($result | append ($it + 1)) } -> $result -╭───┬───╮ -│ 0 │ 2 │ -│ 1 │ 3 │ -│ 2 │ 4 │ -╰───┴───╯ -``` - -### `for` - -[`for`](/commands/docs/for.html) loops over a range or collection like a list or a table. - -```nu -> for x in [1 2 3] { $x * $x | print } -1 -4 -9 -``` - -#### Expression command alternatives - -- [`each`](/commands/docs/each.html) -- [`par-each`](/commands/docs/par-each.html) -- [`where`](/commands/docs/where.html)/[`filter`](/commands/docs/filter.html) -- [`reduce`](/commands/docs/reduce.html) - -### `while` - -[`while`](/commands/docs/while.html) loops the same block of code until the given condition is `false`. - -```nu -> mut x = 0; while $x < 10 { $x = $x + 1 }; $x -10 -``` - -#### Expression command alternatives - -The "until" and other "while" commands - -- [`take until`](/commands/docs/take_until.html) -- [`take while`](/commands/docs/take_while.html) -- [`skip until`](/commands/docs/skip_until.html) -- [`skip while`](/commands/docs/skip_while.html) - -### `loop` - -[`loop`](/commands/docs/loop.html) loops a block infinitely. You can use [`break`](/commands/docs/break.html) (as described in the next section) to limit how many times it loops. It can also be handy for continuously running scripts, like an interactive prompt. - -```nu -> mut x = 0; loop { if $x > 10 { break }; $x = $x + 1 }; $x -11 -``` - -### `break` - -[`break`](/commands/docs/break.html) will stop executing the code in a loop and resume execution after the loop. Effectively "break"ing out of the loop. - -```nu -> for x in 1..10 { if $x > 3 { break }; print $x } -1 -2 -3 -``` - -### `continue` - -[`continue`](/commands/docs/continue.html) will stop execution of the current loop, skipping the rest of the code in the loop, and will go to the next loop. If the loop would normally end, like if [`for`](/commands/docs/for.html) has iterated through all the given elements, or if [`while`](/commands/docs/while.html)'s condition is now false, it won't loop again and execution will continue after the loop block. - -```nu -> mut x = -1; while $x <= 6 { $x = $x + 1; if $x mod 3 == 0 { continue }; print $x } -1 -2 -4 -5 -7 -``` - -## Errors - -### `error make` - -[`error make`](/commands/docs/error_make.html) creates an error that stops execution of the code and any code that called it, until either it is handled by a [`try`](/commands/docs/try.html) block, or it ends the script and outputs the error message. This functionality is the same as "exceptions" in other languages. - -```nu -> print 'printed'; error make { msg: 'Some error info' }; print 'unprinted' -printed -Error: × Some error info - ╭─[entry #9:1:1] - 1 │ print 'printed'; error make { msg: 'Some error info' }; print 'unprinted' - · ─────┬──── - · ╰── originates from here - ╰──── -``` - -The record passed to it provides some information to the code that catches it or the resulting error message. - -You can find more information about [`error make`](/commands/docs/error_make.html) and error concepts on the [Creating your own errors page](/book/creating_errors.html). - -### `try` - -[`try`](/commands/docs/try.html) will catch errors created anywhere in the [`try`](/commands/docs/try.html)'s code block and resume execution of the code after the block. - -```nu -> try { error make { msg: 'Some error info' }}; print 'Resuming' -Resuming -``` - -This includes catching built in errors. - -```nu -> try { 1 / 0 }; print 'Resuming' -Resuming -``` - -The resulting value will be `nothing` if an error occurs and the returned value of the block if an error did not occur. - -If you include a `catch` block after the [`try`](/commands/docs/try.html) block, it will execute the code in the `catch` block if an error occurred in the [`try`](/commands/docs/try.html) block. - -```nu -> try { 1 / 0 } catch { 'An error happened!' } | $in ++ ' And now I am resuming.' -An error happened! And now I am resuming. -``` - -It will not execute the `catch` block if an error did not occur. - -## Other - -### `return` - -[`return`](/commands/docs/return.html) Ends a closure or command early where it is called, without running the rest of the command/closure, and returns the given value. Not often necessary since the last value in a closure or command is also returned, but it can sometimes be convenient. - -```nu -def 'positive-check' [it] { - if $it > 0 { - return 'positive' - }; - - 'non-positive' -} -``` - -```nu -> positive-check 3 -positive - -> positive-check (-3) -non-positive - -> let positive_check = {|it| if $it > 0 { return 'positive' }; 'non-positive' } - -> do $positive_check 3 -positive - -> do $positive_check (-3) -non-positive -``` diff --git a/book/escaping.md b/book/escaping.md deleted file mode 100644 index 0b819c70ae1..00000000000 --- a/book/escaping.md +++ /dev/null @@ -1,19 +0,0 @@ -# Escaping to the system - -Nu provides a set of commands that you can use across different OSes ("internal" commands), and having this consistency is helpful. Sometimes, though, you want to run an external command that has the same name as an internal Nu command. To run the external [`ls`](/commands/docs/ls.md) or [`date`](/commands/docs/date.md) command, for example, you use the caret (^) command. Escaping with the caret prefix calls the command that's in the user's PATH (e.g. `/bin/ls` instead of Nu's internal [`ls`](/commands/docs/ls.md) command). - -Nu internal command: - -```nu -> ls -``` - -Escape to external command: - -```nu -> ^ls -``` - -## Windows note - -When running an external command on Windows, nushell [used to](https://www.nushell.sh/blog/2022-08-16-nushell-0_67.html#windows-cmd-exe-changes-rgwood) use [Cmd.exe](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) to run the command, as a number of common commands on Windows are actually shell builtins and not available as separate executables. [Coming from CMD.EXE](coming_from_cmd.md) contains a list of these commands and how to map them to nushell native concepts. diff --git a/book/getting_started.md b/book/getting_started.md deleted file mode 100644 index 956254238cc..00000000000 --- a/book/getting_started.md +++ /dev/null @@ -1,9 +0,0 @@ -# Getting Started - -Let's get started! :elephant: - -First, to be able to use Nushell, we need to [install it](installation.md). - -The next sections will give you a [short tour of Nushell by example](quick_tour.md) (including how to get help from within Nushell), and show you how to [move around your file system](moving_around.md). - -Finally, because Nushell takes some design decisions that are quite different from typical shells or dynamic scripting languages, make sure to check [Thinking in Nu](thinking_in_nu.md) that explains some of these concepts. diff --git a/book/introduction.md b/book/introduction.md deleted file mode 100644 index 6ebb4de923c..00000000000 --- a/book/introduction.md +++ /dev/null @@ -1,73 +0,0 @@ -# Quick Tour - -Nu takes cues from a lot of familiar territory: traditional shells like bash, object based shells like PowerShell, gradually typed languages like TypeScript, functional programming, systems programming, and more. But rather than trying to be a jack of all trades, Nu focuses its energy on doing a few things well: - -- Being a flexible cross-platform shell with a modern feel -- Solving problems as a modern programming language that works with the structure of your data -- Giving clear error messages and clean IDE support - -The easiest way to see what Nu can do is to start with some examples, so let's dive in. - -The first thing you'll notice when you run a command like [`ls`](/commands/docs/ls.md) is that instead of a block of text coming back, you get a structured table. - -@[code](@snippets/introduction/ls_example.sh) - -The table is more than just showing the directory in a different way. Just like tables in a spreadsheet, this table allows us to work with the data more interactively. - -The first thing we'll do is to sort our table by size. To do this, we'll take the output from [`ls`](/commands/docs/ls.md) and feed it into a command that can sort tables based on the contents of a column. - -@[code](@snippets/introduction/ls_sort_by_reverse_example.sh) - -You can see that to make this work we didn't pass commandline arguments to [`ls`](/commands/docs/ls.md). Instead, we used the [`sort-by`](/commands/docs/sort-by.md) command that Nu provides to do the sorting of the output of the [`ls`](/commands/docs/ls.md) command. To see the biggest files on top, we also used [`reverse`](/commands/docs/reverse.md). - -Nu provides many commands that can work on tables. For example, we could filter the contents of the [`ls`](/commands/docs/ls.md) table so that it only shows files over 1 kilobyte: - -@[code](@snippets/introduction/ls_where_example.sh) - -Just as in the Unix philosophy, being able to have commands talk to each other gives us ways to mix-and-match in many different combinations. Let's look at a different command: - -@[code](@snippets/introduction/ps_example.sh) - -You may be familiar with the [`ps`](/commands/docs/ps.md) command if you've used Linux. With it, we can get a list of all the current processes that the system is running, what their status is, and what their name is. We can also see the CPU load for the processes. - -What if we wanted to show the processes that were actively using the CPU? Just like we did with the [`ls`](/commands/docs/ls.md) command earlier, we can also work with the table that the [`ps`](/commands/docs/ps.md) command gives back to us: - -@[code](@snippets/introduction/ps_where_example.sh) - -So far, we've been using [`ls`](/commands/docs/ls.md) and [`ps`](/commands/docs/ps.md) to list files and processes. Nu also offers other commands that can create tables of useful information. Next, let's explore [`date`](/commands/docs/date.md) and [`sys`](/commands/docs/sys.md). - -Running [`date now`](/commands/docs/date_now.md) gives us information about the current day and time: - -@[code](@snippets/introduction/date_example.sh) - -To get the date as a table we can feed it into [`date to-table`](/commands/docs/date_to-table.md) - -@[code](@snippets/introduction/date_table_example.sh) - -Running [`sys`](/commands/docs/sys.md) gives information about the system that Nu is running on: - -@[code](@snippets/introduction/sys_example.sh) - -This is a bit different than the tables we saw before. The [`sys`](/commands/docs/sys.md) command gives us a table that contains structured tables in the cells instead of simple values. To take a look at this data, we need to _get_ the column to view: - -@[code](@snippets/introduction/sys_get_example.sh) - -The [`get`](/commands/docs/get.md) command lets us jump into the contents of a column of the table. Here, we're looking into the "host" column, which contains information about the host that Nu is running on. The name of the OS, the hostname, the CPU, and more. Let's get the name of the users on the system: - -@[code](@snippets/introduction/sys_get_nested_example.sh) - -Right now, there's just one user on the system named "jt". You'll notice that we can pass a column path (the `host.sessions.name` part) and not just the name of the column. Nu will take the column path and go to the corresponding bit of data in the table. - -You might have noticed something else that's different. Rather than having a table of data, we have just a single element: the string "jt". Nu works with both tables of data as well as strings. Strings are an important part of working with commands outside of Nu. - -Let's see how strings work outside of Nu in action. We'll take our example from before and run the external [`echo`](/commands/docs/echo.md) command (the `^` tells Nu to not use the built-in [`echo`](/commands/docs/echo.md) command): - -@[code](@snippets/introduction/sys_get_external_echo_example.sh) - -If this looks very similar to what we had before, you have a keen eye! It is similar, but with one important difference: we've called `^echo` with the value we saw earlier. This allows us to pass data out of Nu into [`echo`](/commands/docs/echo.md) (or any command outside of Nu, like `git` for example). - -### Getting Help - -Help text for any of Nu's built-in commands can be discovered with the [`help`](/commands/docs/help.md) command. To see all commands, run [`help commands`](/commands/docs/help_commands.md). You can also search for a topic by doing `help -f `. - -@[code](@snippets/introduction/help_example.sh) diff --git a/book/moving_around.md b/book/moving_around.md deleted file mode 100644 index f7a4758fb9c..00000000000 --- a/book/moving_around.md +++ /dev/null @@ -1,66 +0,0 @@ -# Moving around your system - -Early shells allow you to move around your filesystem and run commands, and modern shells like Nu allow you to do the same. Let's take a look at some of the common commands you might use when interacting with your system. - -## Viewing directory contents - -@[code](@snippets/moving_around/ls_example.sh) - -As we've seen in other chapters, [`ls`](/commands/docs/ls.md) is a command for viewing the contents of a path. Nu will return the contents as a table that we can use. - -The [`ls`](/commands/docs/ls.md) command also takes an optional argument, to change what you'd like to view. For example, we can list the files that end in ".md" - -@[code](@snippets/moving_around/ls_shallow_glob_example.sh) - -## Glob patterns (wildcards) - -The asterisk (\*) in the above optional argument "\*.md" is sometimes called a wildcard or a glob. It lets us match anything. You could read the glob "\*.md" as "match any filename, so long as it ends with '.md' " - -The most general glob is `*`, which will match all paths. More often, you'll see this pattern used as part of another pattern, for example `*.bak` and `temp*`. - -In Nushell, we also support double `*` to talk about traversing deeper paths that are nested inside of other directories. For example, `ls **/*` will list all the non-hidden paths nested under the current directory. - -@[code](@snippets/moving_around/ls_deep_glob_example.sh) - -Here, we're looking for any file that ends with ".md", and the two asterisks further say "in any directory starting from here". - -In other shells (like bash), glob expansion happens in the shell and the invoked program (`ls` in the example above) receives a list of matched files. In Nushell however, the string you enter is passed "as is" to the command, and some commands (like `ls`, `mv`, `cp` and `rm`) interpret their input string as a glob pattern. For example the [`ls` command's help page](https://www.nushell.sh/commands/docs/ls.html) shows that it takes the parameter: `pattern: the glob pattern to use (optional)`. - -Globbing syntax in these commands not only supports `*`, but also matching [single characters with `?` and character groups with `[...]`](https://docs.rs/nu-glob/latest/nu_glob/struct.Pattern.html). Note that this is a more limited syntax than what the dedicated [`glob` Nushell command](https://www.nushell.sh/commands/docs/glob.html) supports. - -Escaping `*`, `?`, `[]` works by quoting them with single quotes or double quotes. To show the contents of a directory named `[slug]`, use `ls "[slug]"` or `ls '[slug]'`. -Note that backtick quote doesn't escape glob, for example: cp `test dir/*` will copy all files inside `test dir` to current direcroty. - -## Changing the current directory - -@[code](@snippets/moving_around/cd_example.sh) - -To change from the current directory to a new one, we use the [`cd`](/commands/docs/cd.md) command. Just as in other shells, we can use either the name of the directory, or if we want to go up a directory we can use the `..` shortcut. - -Changing the current working directory can also be done if [`cd`](/commands/docs/cd.md) is omitted and a path by itself is given: - -@[code](@snippets/moving_around/cd_without_command_example.sh) - -**Note:** changing the directory with [`cd`](/commands/docs/cd.md) changes the `PWD` environment variable. This means that a change of a directory is kept to the current block. Once you exit the block, you'll return to the previous directory. You can learn more about working with this in the [environment chapter](./environment.md). - -## Filesystem commands - -Nu also provides some basic filesystem commands that work cross-platform. - -We can move an item from one place to another using the [`mv`](/commands/docs/mv.md) command: - -@[code](@snippets/moving_around/mv_example.sh) - -We can copy an item from one location to another with the [`cp`](/commands/docs/cp.md) command: - -@[code](@snippets/moving_around/cp_example.sh) - -We can remove an item with the [`rm`](/commands/docs/rm.md) command: - -@[code](@snippets/moving_around/rm_example.sh) - -The three commands also can use the glob capabilities we saw earlier with [`ls`](/commands/docs/ls.md). - -Finally, we can create a new directory using the [`mkdir`](/commands/docs/mkdir.md) command: - -@[code](@snippets/moving_around/mkdir_example.sh) diff --git a/book/nushell_map.md b/book/nushell_map.md deleted file mode 100644 index c011e9ab91a..00000000000 --- a/book/nushell_map.md +++ /dev/null @@ -1,75 +0,0 @@ -# Nu map from other shells and domain specific languages - -The idea behind this table is to help you understand how Nu builtins and plugins relate to other known shells and domain specific languages. We've tried to produce a map of relevant Nu commands and what their equivalents are in other languages. Contributions are welcome. - -Note: this table assumes Nu 0.43 or later. - - -| Nushell | SQL | .Net LINQ (C#) | PowerShell (without external modules) | Bash | -| ---------------------- | ----------------------------- | ---------------------------------------------------- | ------------------------------------------ | ----------------------------------------------- | -| alias | | | alias | alias | -| append | | Append | -Append | | -| math avg | avg | Average | Measure-Object, measure | | -| calc, `` | math operators | Aggregate, Average, Count, Max, Min, Sum | | bc | -| cd | | | Set-Location, cd | cd | -| clear | | | Clear-Host | clear | -| config | | | $Profile | vi .bashrc, .profile | -| cp | | | Copy-Item, cp, copy | cp | -| date | NOW() / getdate() | DateTime class | Get-Date | date | -| du | | | | du | -| each | cursor | | ForEach-Object, foreach, for | | -| exit | | | exit | exit | -| http | | HttpClient,WebClient, HttpWebRequest/Response | Invoke-WebRequest | wget | -| first | top, limit | First, FirstOrDefault | Select-Object -First | head | -| format | | String.Format | String.Format | | -| from | import flatfile, openjson, cast(variable as xml) | | Import/ConvertFrom-{Csv,Xml,Html,Json} | | -| get | | Select | (cmd).column | | -| group-by | group by | GroupBy, group | Group-Object, group | | -| help | sp_help | | Get-Help, help, man | man | -| history | | | Get-History, history | history | -| is-empty | is null | String.InNullOrEmpty | String.InNullOrEmpty | | -| kill | | | Stop-Process, kill | kill | -| last | | Last, LastOrDefault | Select-Object -Last | tail | -| length | count | Count | Measure-Object, measure | wc | -| lines | | | File.ReadAllLines | | -| ls | | | Get-ChildItem, dir, ls | ls | -| mkdir | | | mkdir, md | mkdir | -| mv | | | Move-Item, mv, move, mi | mv | -| nth | limit x offset y, rownumber = | ElementAt | [x], indexing operator, ElementAt | | -| open | | | Get-Content, gc, cat, type | cat | -| print | print, union all | | Write-Output, write | echo | -| transpose | pivot | | | | -| ps | | | Get-Process, ps, gps | ps | -| pwd | | | Get-Location, pwd | pwd | -| range | | Range | 1..10, 'a'..'f' | | -| reduce | | Aggregate | | | -| rename | | | Rename-Item, ren, rni | mv | -| reverse | | Reverse | [Array]::Reverse($var) | | -| rm | | | Remove-Item, del, erase, rd, ri, rm, rmdir | rm | -| save | | | Write-Output, Out-File | > foo.txt | -| select | select | Select | Select-Object, select | | -| shuffle | | Random | Sort-Object {Get-Random} | | -| size | | | Measure-Object, measure | wc | -| skip | where row_number() | Skip | Select-Object -Skip | | -| skip until | | SkipWhile | | | -| skip while | | SkipWhile | | | -| sort-by | order by | OrderBy, OrderByDescending, ThenBy, ThenByDescending | Sort-Object, sort | | -| split-by | | Split | Split | | -| str | string functions | String class | String class | | -| str join | concat_ws | Join | Join-String | | -| str trim | rtrim, ltrim | Trim, TrimStart, TrimEnd | Trim | | -| sum | sum | Sum | Measure-Object, measure | | -| sys | | | Get-ComputerInfo | uname, lshw, lsblk, lscpu, lsusb, hdparam, free | -| table | | | Format-Table, ft, Format-List, fl | | -| take | top, limit | Take | Select-Object -First | head | -| take until | | TakeWhile | | | -| take while | | TakeWhile | | | -| timeit | | | Measure-Command | time | -| to | | | Export/ConvertTo-{Csv,Xml,Html,Json} | | -| touch | | | Set-Content | touch | -| uniq | distinct | Distinct | Get-Unique, gu | uniq | -| upsert | As | | | | -| version | select @@version | | $PSVersionTable | | -| with-env | | | $env:FOO = 'bar' | export foo = "bar" | -| where | where | Where | Where-Object, where, "?" operator | | -| which | | | | which | diff --git a/book/nushell_map_imperative.md b/book/nushell_map_imperative.md deleted file mode 100644 index 12d91c5f92d..00000000000 --- a/book/nushell_map_imperative.md +++ /dev/null @@ -1,76 +0,0 @@ -# Nu map from imperative languages - -The idea behind this table is to help you understand how Nu built-ins and plugins relate to imperative languages. We've tried to produce a map of programming-relevant Nu commands and what their equivalents are in other languages. Contributions are welcome. - -Note: this table assumes Nu 0.43 or later. - -| Nushell | Python | Kotlin (Java) | C++ | Rust | -| ------------ | ------------------------------------ | --------------------------------------------------- | ----------------------- | -------------------------------------------------- | -| append | list.append, set.add | add | push_back, emplace_back | push, push_back | -| math avg | statistics.mean | | | | -| calc, = math | math operators | math operators | math operators | math operators | -| count | len | size, length | length | len | -| cp | shutil.copy | | | fs::copy | -| date | datetime.date.today | java.time.LocalDate.now | | | -| drop | list[:-3] | | | | -| du | shutil.disk_usage | | | | -| each | for | for | for | for | -| exit | exit | System.exit, kotlin.system.exitProcess | exit | exit | -| http get | urllib.request.urlopen | | | | -| first | list[:x] | List[0], peek | vector[0], top | Vec[0] | -| format | format | format | format | format! | -| from | csv, json, sqlite3 | | | | -| get | dict[\"key\"] | Map[\"key\"] | map[\"key\"] | HashMap["key"], get, entry | -| group-by | itertools.groupby | groupBy | | group_by | -| headers | keys | | | | -| help | help | | | | -| insert | dict[\"key\"] = val | | map.insert({ 20, 130 }) | map.insert(\"key\", val) | -| is-empty | is None, is [] | isEmpty | empty | is_empty | -| take | list[:x] | | | &Vec[..x] | -| take until | itertools.takewhile | | | | -| take while | itertools.takewhile | | | | -| kill | os.kill | | | | -| last | list[-x:] | | | &Vec[Vec.len()-1] | -| lines | split, splitlines | split | views::split | split, split_whitespace, rsplit, lines | -| ls | os.listdir | | | fs::read_dir | -| match | match | when | | match | -| merge | dict.append | | | map.extend | -| mkdir | os.mkdir | | | fs::create_dir | -| mv | shutil.move | | | fs::rename | -| get | list[x] | List[x] | vector[x] | Vec[x] | -| open | open | | | | -| transpose | zip(\*matrix) | | | | -| http post | urllib.request.urlopen | | | | -| prepend | deque.appendleft | | | | -| print | print | println | printf | println! | -| ps | os.listdir('/proc') | | | | -| pwd | os.getcwd | | | env::current_dir | -| range | range | .., until, downTo, step | iota | .. | -| reduce | functools.reduce | reduce | reduce | fold, rfold, scan | -| reject | del | | | | -| rename | dict[\"key2\"] = dict.pop(\"key\") | | | map.insert(\"key2\", map.remove(\"key\").unwrap()); | -| reverse | reversed, list.reverse | reverse, reversed, asReversed | reverse | rev | -| rm | os.remove | | | | -| save | io.TextIOWrapper.write | | | | -| select | {k:dict[k] for k in keys} | | | | -| shuffle | random.shuffle | | | | -| size | len | | | len | -| skip | list[x:] | | | &Vec[x..],skip | -| skip until | itertools.dropwhile | | | | -| skip while | itertools.dropwhile | | | skip_while | -| sort-by | sorted, list.sort | sortedBy, sortedWith, Arrays.sort, Collections.sort | sort | sort | -| split row | str.split{,lines}, re.split | split | views::split | split | -| str | str functions | String functions | string functions | &str, String functions | -| str join | str.join | joinToString | | join | -| str trim | strip, rstrip, lstrip | trim, trimStart, trimEnd | regex | trim, trim*{start,end}, strip*{suffix,prefix} | -| sum | sum | sum | reduce | sum | -| sys | sys | | | | -| to | import csv, json, sqlite3 | | | | -| touch | open(path, 'a').close() | | | | -| uniq | set | Set | set | HashSet | -| upsert | dict[\"key\"] = val | | | | -| version | sys.version, sys.version_info | | | | -| with-env | os.environ | | | | -| where | filter | filter | filter | filter | -| which | shutil.which | | | | -| wrap | { "key" : val } | | | | diff --git a/book/quick_tour.md b/book/quick_tour.md deleted file mode 100644 index 231cb3e7b02..00000000000 --- a/book/quick_tour.md +++ /dev/null @@ -1,67 +0,0 @@ -# Quick Tour - -The easiest way to see what Nu can do is to start with some examples, so let's dive in. - -The first thing you'll notice when you run a command like [`ls`](/commands/docs/ls.md) is that instead of a block of text coming back, you get a structured table. - -@[code](@snippets/introduction/ls_example.sh) - -The table does more than show the directory in a different way. Just like tables in a spreadsheet, this table allows us to work with the data more interactively. - -The first thing we'll do is to sort our table by size. To do this, we'll take the output from [`ls`](/commands/docs/ls.md) and feed it into a command that can sort tables based on the contents of a column. - -@[code](@snippets/introduction/ls_sort_by_reverse_example.sh) - -You can see that to make this work we didn't pass commandline arguments to [`ls`](/commands/docs/ls.md). Instead, we used the [`sort-by`](/commands/docs/sort-by.md) command that Nu provides to do the sorting of the output of the [`ls`](/commands/docs/ls.md) command. To see the biggest files on top, we also used [`reverse`](/commands/docs/reverse.md). - -Nu provides many commands that can work on tables. For example, we could use [`where`](/commands/docs/where.md) to filter the contents of the [`ls`](/commands/docs/ls.md) table so that it only shows files over 1 kilobyte: - -@[code](@snippets/introduction/ls_where_example.sh) - -Just as in the Unix philosophy, being able to have commands talk to each other gives us ways to mix-and-match in many different combinations. Let's look at a different command: - -@[code](@snippets/introduction/ps_example.sh) - -You may be familiar with the [`ps`](/commands/docs/ps.md) command if you've used Linux. With it, we can get a list of all the current processes that the system is running, what their status is, and what their name is. We can also see the CPU load for the processes. - -What if we wanted to show the processes that were actively using the CPU? Just like we did with the [`ls`](/commands/docs/ls.md) command earlier, we can also work with the table that the [`ps`](/commands/docs/ps.md) command gives back to us: - -@[code](@snippets/introduction/ps_where_example.sh) - -So far, we've been using [`ls`](/commands/docs/ls.md) and [`ps`](/commands/docs/ps.md) to list files and processes. Nu also offers other commands that can create tables of useful information. Next, let's explore [`date`](/commands/docs/date.md) and [`sys`](/commands/docs/sys.md). - -Running [`date now`](/commands/docs/date_now.md) gives us information about the current day and time: - -@[code](@snippets/introduction/date_example.sh) - -To get the date as a table we can feed it into [`date to-table`](/commands/docs/date_to-table.md) - -@[code](@snippets/introduction/date_table_example.sh) - -Running [`sys`](/commands/docs/sys.md) gives information about the system that Nu is running on: - -@[code](@snippets/introduction/sys_example.sh) - -This is a bit different than the tables we saw before. The [`sys`](/commands/docs/sys.md) command gives us a table that contains structured tables in the cells instead of simple values. To take a look at this data, we need to _get_ the column to view: - -@[code](@snippets/introduction/sys_get_example.sh) - -The [`get`](/commands/docs/get.md) command lets us jump into the contents of a column of the table. Here, we're looking into the "host" column, which contains information about the host that Nu is running on. The name of the OS, the hostname, the CPU, and more. Let's get the name of the users on the system: - -@[code](@snippets/introduction/sys_get_nested_example.sh) - -Right now, there's just one user on the system named "jt". You'll notice that we can pass a column path (the `host.sessions.name` part) and not just the name of the column. Nu will take the column path and go to the corresponding bit of data in the table. - -You might have noticed something else that's different. Rather than having a table of data, we have just a single element: the string "jt". Nu works with both tables of data as well as strings. Strings are an important part of working with commands outside of Nu. - -Let's see how strings work outside of Nu in action. We'll take our example from before and run the external [`echo`](/commands/docs/echo.md) command (the `^` tells Nu to not use the built-in [`echo`](/commands/docs/echo.md) command): - -@[code](@snippets/introduction/sys_get_external_echo_example.sh) - -If this looks very similar to what we had before, you have a keen eye! It is similar, but with one important difference: we've called `^echo` with the value we saw earlier. This allows us to pass data out of Nu into [`echo`](/commands/docs/echo.md) (or any command outside of Nu, like `git` for example). - -### Getting Help - -Help text for any of Nu's built-in commands can be discovered with the [`help`](/commands/docs/help.md) command. To see all commands, run [`help commands`](/commands/docs/help_commands.md). You can also search for a topic by doing `help -f `. - -@[code](@snippets/introduction/help_example.sh) diff --git a/book/table_of_contents.md b/book/table_of_contents.md deleted file mode 100644 index 3d35b062021..00000000000 --- a/book/table_of_contents.md +++ /dev/null @@ -1,41 +0,0 @@ -# Table of Contents - -- [Installation](installation.md) - Installing Nushell -- [Introduction](README.md) - Getting started -- [Thinking in Nushell](thinking_in_nushell.md) - Thinking in Nushell -- [Moving around](moving_around.md) - Moving around in Nushell -- [Types of data](types_of_data.md) - Types of data in Nushell -- [Loading data](loading_data.md) - Loading data and using it -- [Strings](working_with_strings.md) - Strings, escape characters, and string interpolation -- [Working with lists](working_with_lists.md) - Working with Nu lists -- [Working with tables](working_with_tables.md) - Working with Nu tables -- [Pipeline](pipeline.md) - How the pipeline works -- [Configuration](configuration.md) - How to configure Nushell -- [3rd Party Prompts](3rdpartyprompts.md) - How to configure 3rd party prompts -- [Custom commands](custom_commands.md) - Creating your own commands -- [Aliases](aliases.md) - How to alias commands -- [Operators](operators.md) - Operators supported by Nushell -- [Variables and subexpressions](variables_and_subexpressions.md) - Working with variables and working with subexpressions -- [Control flow](control_flow.md) - Working with the control flow commands -- [Environment](environment.md) - Working with environment variables -- [Stdout, stderr, and exit codes](stdout_stderr_exit_codes.md) - Working with stdout, stderr, and exit codes -- [Modules](modules.md) - Creating and using your own modules -- [Hooks](hooks.md) - Adding code snippets to be run automatically -- [Scripts](scripts.md) - Creating your own scripts -- [Metadata](metadata.md) - An explanation of Nu's metadata system -- [Creating your own errors](creating_errors.md) - Creating your own error messages -- [Shells](shells_in_shells.md) - Working with multiple locations -- [Escaping commands](escaping.md) - Escaping to native commands of the same name -- [Plugins](plugins.md) - Enhancing Nushell with more features using plugins -- [Parallelism](parallelism.md) - Running your code in parallel -- [Line editor](line_editor.md) - Nushell's line editor -- [Dataframes](dataframes.md) - Working with dataframes in Nushell -- [Explore](explore.md) - Using the Nushell TUI -- [Coloring and Theming](coloring_and_theming.md) - How to change the colors and themes in Nushell -- [Regular Expressions](regular_expressions.md) - Guide to use regex -- [Coming from Bash](coming_from_bash.md) - Guide for those coming to Nushell from Bash -- [Nushell map from shells/DSL](nushell_map.md) - Guide to show how Nushell compares with SQL, LINQ, PowerShell, and Bash -- [Nushell map from imperative languages](nushell_map_imperative.md) - Guide to show how Nushell compares with Python, Kotlin, C++, C#, and Rust -- [Nushell map from functional languages](nushell_map_functional.md) - Guide to show how Nushell compares with Clojure, Tablecloth (OCaml / Elm) and Haskell -- [Nushell operator map](nushell_operator_map.md) - Guide to show how Nushell operators compare with those in general purpose programming languages -- [Command Reference](/commands/) - List of all Nushell's commands diff --git a/commands/README.md b/commands/README.md deleted file mode 100644 index 8e9a4b95aff..00000000000 --- a/commands/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Command Reference - -If you're new to Nushell, [the quick tour](/book/quick_tour.md) can show you the most important commands. You don't need to know them all! - -To see all commands from inside Nushell, run [`help commands`](/commands/docs/help.md). - - - - - - - - - - - - - - - - -
CommandCategoriesDescriptionFeature
{{ command.title }}{{ command.frontmatter.categories }}{{ command.frontmatter.usage }}{{ command.frontmatter.feature }}
diff --git a/commands/docs/bits.md b/commands/docs/bits.md deleted file mode 100644 index 362aa4eda1e..00000000000 --- a/commands/docs/bits.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: bits -categories: | - bits -version: 0.90.0 -bits: | - Various commands for working with bits. -usage: | - Various commands for working with bits. -feature: extra ---- - - -# {{ $frontmatter.title }} for bits - -
{{ $frontmatter.bits }}
- - -::: warning - Command `bits` was not included in the official binaries by default, you have to build it with `--features=extra` flag -::: -## Signature - -```> bits {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ---------------------------------------- | ------- | -------------------------------------- | -| [`bits and`](/commands/docs/bits_and.md) | Builtin | Performs bitwise and for ints. | -| [`bits not`](/commands/docs/bits_not.md) | Builtin | Performs logical negation on each bit. | -| [`bits or`](/commands/docs/bits_or.md) | Builtin | Performs bitwise or for ints. | -| [`bits rol`](/commands/docs/bits_rol.md) | Builtin | Bitwise rotate left for ints. | -| [`bits ror`](/commands/docs/bits_ror.md) | Builtin | Bitwise rotate right for ints. | -| [`bits shl`](/commands/docs/bits_shl.md) | Builtin | Bitwise shift left for ints. | -| [`bits shr`](/commands/docs/bits_shr.md) | Builtin | Bitwise shift right for ints. | -| [`bits xor`](/commands/docs/bits_xor.md) | Builtin | Performs bitwise xor for ints. | \ No newline at end of file diff --git a/commands/docs/bytes.md b/commands/docs/bytes.md deleted file mode 100644 index 59722299d7f..00000000000 --- a/commands/docs/bytes.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: bytes -categories: | - bytes -version: 0.90.0 -bytes: | - Various commands for working with byte data. -usage: | - Various commands for working with byte data. -feature: default ---- - - -# {{ $frontmatter.title }} for bytes - -
{{ $frontmatter.bytes }}
- -## Signature - -```> bytes {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ---------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------ | -| [`bytes add`](/commands/docs/bytes_add.md) | Builtin | Add specified bytes to the input. | -| [`bytes at`](/commands/docs/bytes_at.md) | Builtin | Get bytes defined by a range. | -| [`bytes build`](/commands/docs/bytes_build.md) | Builtin | Create bytes from the arguments. | -| [`bytes collect`](/commands/docs/bytes_collect.md) | Builtin | Concatenate multiple binary into a single binary, with an optional separator between each. | -| [`bytes ends-with`](/commands/docs/bytes_ends-with.md) | Builtin | Check if bytes ends with a pattern. | -| [`bytes index-of`](/commands/docs/bytes_index-of.md) | Builtin | Returns start index of first occurrence of pattern in bytes, or -1 if no match. | -| [`bytes length`](/commands/docs/bytes_length.md) | Builtin | Output the length of any bytes in the pipeline. | -| [`bytes remove`](/commands/docs/bytes_remove.md) | Builtin | Remove bytes. | -| [`bytes replace`](/commands/docs/bytes_replace.md) | Builtin | Find and replace binary. | -| [`bytes reverse`](/commands/docs/bytes_reverse.md) | Builtin | Reverse the bytes in the pipeline. | -| [`bytes starts-with`](/commands/docs/bytes_starts-with.md) | Builtin | Check if bytes starts with a pattern. | \ No newline at end of file diff --git a/commands/docs/date.md b/commands/docs/date.md deleted file mode 100644 index 5598046bd69..00000000000 --- a/commands/docs/date.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: date -categories: | - date -version: 0.90.0 -date: | - Date-related commands. -usage: | - Date-related commands. -feature: default ---- - - -# {{ $frontmatter.title }} for date - -
{{ $frontmatter.date }}
- -## Signature - -```> date {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------------------ | ------- | --------------------------------------------------------- | -| [`date format`](/commands/docs/date_format.md) | Builtin | Removed command: use `format date` instead. | -| [`date humanize`](/commands/docs/date_humanize.md) | Builtin | Print a 'humanized' format for the date, relative to now. | -| [`date list-timezone`](/commands/docs/date_list-timezone.md) | Builtin | List supported time zones. | -| [`date now`](/commands/docs/date_now.md) | Builtin | Get the current date. | -| [`date to-record`](/commands/docs/date_to-record.md) | Builtin | Convert the date into a record. | -| [`date to-table`](/commands/docs/date_to-table.md) | Builtin | Convert the date into a structured table. | -| [`date to-timezone`](/commands/docs/date_to-timezone.md) | Builtin | Convert a date to a given time zone. | \ No newline at end of file diff --git a/commands/docs/dfr.md b/commands/docs/dfr.md deleted file mode 100644 index b1c877b2fe8..00000000000 --- a/commands/docs/dfr.md +++ /dev/null @@ -1,147 +0,0 @@ ---- -title: dfr -categories: | - dataframe -version: 0.90.0 -dataframe: | - Operate with data in a dataframe format. -usage: | - Operate with data in a dataframe format. -feature: dataframe ---- - - -# {{ $frontmatter.title }} for dataframe - -
{{ $frontmatter.dataframe }}
- - -::: warning -Dataframe commands were not shipped in the official binaries by default, you have to build it with `--features=dataframe` flag -::: -## Signature - -```> dfr {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| -------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------ | -| [`dfr agg`](/commands/docs/dfr_agg.md) | Builtin | Performs a series of aggregations from a group-by. | -| [`dfr agg-groups`](/commands/docs/dfr_agg-groups.md) | Builtin | Creates an agg_groups expression. | -| [`dfr all-false`](/commands/docs/dfr_all-false.md) | Builtin | Returns true if all values are false. | -| [`dfr all-true`](/commands/docs/dfr_all-true.md) | Builtin | Returns true if all values are true. | -| [`dfr append`](/commands/docs/dfr_append.md) | Builtin | Appends a new dataframe. | -| [`dfr arg-max`](/commands/docs/dfr_arg-max.md) | Builtin | Return index for max value in series. | -| [`dfr arg-min`](/commands/docs/dfr_arg-min.md) | Builtin | Return index for min value in series. | -| [`dfr arg-sort`](/commands/docs/dfr_arg-sort.md) | Builtin | Returns indexes for a sorted series. | -| [`dfr arg-true`](/commands/docs/dfr_arg-true.md) | Builtin | Returns indexes where values are true. | -| [`dfr arg-unique`](/commands/docs/dfr_arg-unique.md) | Builtin | Returns indexes for unique values. | -| [`dfr arg-where`](/commands/docs/dfr_arg-where.md) | Builtin | Creates an expression that returns the arguments where expression is true. | -| [`dfr as`](/commands/docs/dfr_as.md) | Builtin | Creates an alias expression. | -| [`dfr as-date`](/commands/docs/dfr_as-date.md) | Builtin | Converts string to date. | -| [`dfr as-datetime`](/commands/docs/dfr_as-datetime.md) | Builtin | Converts string to datetime. | -| [`dfr cache`](/commands/docs/dfr_cache.md) | Builtin | Caches operations in a new LazyFrame. | -| [`dfr col`](/commands/docs/dfr_col.md) | Builtin | Creates a named column expression. | -| [`dfr collect`](/commands/docs/dfr_collect.md) | Builtin | Collect lazy dataframe into eager dataframe. | -| [`dfr columns`](/commands/docs/dfr_columns.md) | Builtin | Show dataframe columns. | -| [`dfr concat-str`](/commands/docs/dfr_concat-str.md) | Builtin | Creates a concat string expression. | -| [`dfr concatenate`](/commands/docs/dfr_concatenate.md) | Builtin | Concatenates strings with other array. | -| [`dfr contains`](/commands/docs/dfr_contains.md) | Builtin | Checks if a pattern is contained in a string. | -| [`dfr count`](/commands/docs/dfr_count.md) | Builtin | Creates a count expression. | -| [`dfr count-null`](/commands/docs/dfr_count-null.md) | Builtin | Counts null values. | -| [`dfr cumulative`](/commands/docs/dfr_cumulative.md) | Builtin | Cumulative calculation for a series. | -| [`dfr datepart`](/commands/docs/dfr_datepart.md) | Builtin | Creates an expression for capturing the specified datepart in a column. | -| [`dfr drop`](/commands/docs/dfr_drop.md) | Builtin | Creates a new dataframe by dropping the selected columns. | -| [`dfr drop-duplicates`](/commands/docs/dfr_drop-duplicates.md) | Builtin | Drops duplicate values in dataframe. | -| [`dfr drop-nulls`](/commands/docs/dfr_drop-nulls.md) | Builtin | Drops null values in dataframe. | -| [`dfr dtypes`](/commands/docs/dfr_dtypes.md) | Builtin | Show dataframe data types. | -| [`dfr dummies`](/commands/docs/dfr_dummies.md) | Builtin | Creates a new dataframe with dummy variables. | -| [`dfr explode`](/commands/docs/dfr_explode.md) | Builtin | Explodes a dataframe or creates a explode expression. | -| [`dfr expr-not`](/commands/docs/dfr_expr-not.md) | Builtin | Creates a not expression. | -| [`dfr fetch`](/commands/docs/dfr_fetch.md) | Builtin | Collects the lazyframe to the selected rows. | -| [`dfr fill-nan`](/commands/docs/dfr_fill-nan.md) | Builtin | Replaces NaN values with the given expression. | -| [`dfr fill-null`](/commands/docs/dfr_fill-null.md) | Builtin | Replaces NULL values with the given expression. | -| [`dfr filter`](/commands/docs/dfr_filter.md) | Builtin | Filter dataframe based in expression. | -| [`dfr filter-with`](/commands/docs/dfr_filter-with.md) | Builtin | Filters dataframe using a mask or expression as reference. | -| [`dfr first`](/commands/docs/dfr_first.md) | Builtin | Show only the first number of rows or create a first expression | -| [`dfr flatten`](/commands/docs/dfr_flatten.md) | Builtin | An alias for dfr explode. | -| [`dfr get`](/commands/docs/dfr_get.md) | Builtin | Creates dataframe with the selected columns. | -| [`dfr get-day`](/commands/docs/dfr_get-day.md) | Builtin | Gets day from date. | -| [`dfr get-hour`](/commands/docs/dfr_get-hour.md) | Builtin | Gets hour from date. | -| [`dfr get-minute`](/commands/docs/dfr_get-minute.md) | Builtin | Gets minute from date. | -| [`dfr get-month`](/commands/docs/dfr_get-month.md) | Builtin | Gets month from date. | -| [`dfr get-nanosecond`](/commands/docs/dfr_get-nanosecond.md) | Builtin | Gets nanosecond from date. | -| [`dfr get-ordinal`](/commands/docs/dfr_get-ordinal.md) | Builtin | Gets ordinal from date. | -| [`dfr get-second`](/commands/docs/dfr_get-second.md) | Builtin | Gets second from date. | -| [`dfr get-week`](/commands/docs/dfr_get-week.md) | Builtin | Gets week from date. | -| [`dfr get-weekday`](/commands/docs/dfr_get-weekday.md) | Builtin | Gets weekday from date. | -| [`dfr get-year`](/commands/docs/dfr_get-year.md) | Builtin | Gets year from date. | -| [`dfr group-by`](/commands/docs/dfr_group-by.md) | Builtin | Creates a group-by object that can be used for other aggregations. | -| [`dfr implode`](/commands/docs/dfr_implode.md) | Builtin | Aggregates a group to a Series. | -| [`dfr into-df`](/commands/docs/dfr_into-df.md) | Builtin | Converts a list, table or record into a dataframe. | -| [`dfr into-lazy`](/commands/docs/dfr_into-lazy.md) | Builtin | Converts a dataframe into a lazy dataframe. | -| [`dfr into-nu`](/commands/docs/dfr_into-nu.md) | Builtin | Converts a dataframe or an expression into into nushell value for access and exploration. | -| [`dfr is-duplicated`](/commands/docs/dfr_is-duplicated.md) | Builtin | Creates mask indicating duplicated values. | -| [`dfr is-in`](/commands/docs/dfr_is-in.md) | Builtin | Creates an is-in expression. | -| [`dfr is-not-null`](/commands/docs/dfr_is-not-null.md) | Builtin | Creates mask where value is not null. | -| [`dfr is-null`](/commands/docs/dfr_is-null.md) | Builtin | Creates mask where value is null. | -| [`dfr is-unique`](/commands/docs/dfr_is-unique.md) | Builtin | Creates mask indicating unique values. | -| [`dfr join`](/commands/docs/dfr_join.md) | Builtin | Joins a lazy frame with other lazy frame. | -| [`dfr last`](/commands/docs/dfr_last.md) | Builtin | Creates new dataframe with tail rows or creates a last expression. | -| [`dfr lit`](/commands/docs/dfr_lit.md) | Builtin | Creates a literal expression. | -| [`dfr lowercase`](/commands/docs/dfr_lowercase.md) | Builtin | Lowercase the strings in the column. | -| [`dfr ls`](/commands/docs/dfr_ls.md) | Builtin | Lists stored dataframes. | -| [`dfr max`](/commands/docs/dfr_max.md) | Builtin | Creates a max expression or aggregates columns to their max value. | -| [`dfr mean`](/commands/docs/dfr_mean.md) | Builtin | Creates a mean expression for an aggregation or aggregates columns to their mean value. | -| [`dfr median`](/commands/docs/dfr_median.md) | Builtin | Aggregates columns to their median value | -| [`dfr melt`](/commands/docs/dfr_melt.md) | Builtin | Unpivot a DataFrame from wide to long format. | -| [`dfr min`](/commands/docs/dfr_min.md) | Builtin | Creates a min expression or aggregates columns to their min value. | -| [`dfr n-unique`](/commands/docs/dfr_n-unique.md) | Builtin | Counts unique values. | -| [`dfr not`](/commands/docs/dfr_not.md) | Builtin | Inverts boolean mask. | -| [`dfr open`](/commands/docs/dfr_open.md) | Builtin | Opens CSV, JSON, JSON lines, arrow, avro, or parquet file to create dataframe. | -| [`dfr otherwise`](/commands/docs/dfr_otherwise.md) | Builtin | Completes a when expression. | -| [`dfr quantile`](/commands/docs/dfr_quantile.md) | Builtin | Aggregates the columns to the selected quantile. | -| [`dfr query`](/commands/docs/dfr_query.md) | Builtin | Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause. | -| [`dfr rename`](/commands/docs/dfr_rename.md) | Builtin | Rename a dataframe column. | -| [`dfr replace`](/commands/docs/dfr_replace.md) | Builtin | Replace the leftmost (sub)string by a regex pattern. | -| [`dfr replace-all`](/commands/docs/dfr_replace-all.md) | Builtin | Replace all (sub)strings by a regex pattern. | -| [`dfr reverse`](/commands/docs/dfr_reverse.md) | Builtin | Reverses the LazyFrame | -| [`dfr rolling`](/commands/docs/dfr_rolling.md) | Builtin | Rolling calculation for a series. | -| [`dfr sample`](/commands/docs/dfr_sample.md) | Builtin | Create sample dataframe. | -| [`dfr schema`](/commands/docs/dfr_schema.md) | Builtin | Show schema for a dataframe. | -| [`dfr select`](/commands/docs/dfr_select.md) | Builtin | Selects columns from lazyframe. | -| [`dfr set`](/commands/docs/dfr_set.md) | Builtin | Sets value where given mask is true. | -| [`dfr set-with-idx`](/commands/docs/dfr_set-with-idx.md) | Builtin | Sets value in the given index. | -| [`dfr shape`](/commands/docs/dfr_shape.md) | Builtin | Shows column and row size for a dataframe. | -| [`dfr shift`](/commands/docs/dfr_shift.md) | Builtin | Shifts the values by a given period. | -| [`dfr slice`](/commands/docs/dfr_slice.md) | Builtin | Creates new dataframe from a slice of rows. | -| [`dfr sort-by`](/commands/docs/dfr_sort-by.md) | Builtin | Sorts a lazy dataframe based on expression(s). | -| [`dfr std`](/commands/docs/dfr_std.md) | Builtin | Creates a std expression for an aggregation of std value from columns in a dataframe. | -| [`dfr str-lengths`](/commands/docs/dfr_str-lengths.md) | Builtin | Get lengths of all strings. | -| [`dfr str-slice`](/commands/docs/dfr_str-slice.md) | Builtin | Slices the string from the start position until the selected length. | -| [`dfr strftime`](/commands/docs/dfr_strftime.md) | Builtin | Formats date based on string rule. | -| [`dfr sum`](/commands/docs/dfr_sum.md) | Builtin | Creates a sum expression for an aggregation or aggregates columns to their sum value. | -| [`dfr summary`](/commands/docs/dfr_summary.md) | Builtin | For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns. | -| [`dfr take`](/commands/docs/dfr_take.md) | Builtin | Creates new dataframe using the given indices. | -| [`dfr to-arrow`](/commands/docs/dfr_to-arrow.md) | Builtin | Saves dataframe to arrow file. | -| [`dfr to-avro`](/commands/docs/dfr_to-avro.md) | Builtin | Saves dataframe to avro file. | -| [`dfr to-csv`](/commands/docs/dfr_to-csv.md) | Builtin | Saves dataframe to CSV file. | -| [`dfr to-jsonl`](/commands/docs/dfr_to-jsonl.md) | Builtin | Saves dataframe to a JSON lines file. | -| [`dfr to-parquet`](/commands/docs/dfr_to-parquet.md) | Builtin | Saves dataframe to parquet file. | -| [`dfr unique`](/commands/docs/dfr_unique.md) | Builtin | Returns unique values from a dataframe. | -| [`dfr uppercase`](/commands/docs/dfr_uppercase.md) | Builtin | Uppercase the strings in the column. | -| [`dfr value-counts`](/commands/docs/dfr_value-counts.md) | Builtin | Returns a dataframe with the counts for unique values in series. | -| [`dfr var`](/commands/docs/dfr_var.md) | Builtin | Create a var expression for an aggregation. | -| [`dfr when`](/commands/docs/dfr_when.md) | Builtin | Creates and modifies a when expression. | -| [`dfr with-column`](/commands/docs/dfr_with-column.md) | Builtin | Adds a series to the dataframe. | \ No newline at end of file diff --git a/commands/docs/export.md b/commands/docs/export.md deleted file mode 100644 index 2139a644443..00000000000 --- a/commands/docs/export.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: export -categories: | - core -version: 0.90.0 -core: | - Export definitions or environment variables from a module. -usage: | - Export definitions or environment variables from a module. -feature: default ---- - - -# {{ $frontmatter.title }} for core - -
{{ $frontmatter.core }}
- -## Signature - -```> export {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------- | -| nothing | nothing | - -## Examples - -Export a definition from a module -```nu -> module utils { export def my-command [] { "hello" } }; use utils my-command; my-command -hello -``` - -## Notes -This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html - -## Subcommands: - -| name | type | usage | -| -------------------------------------------------- | ------- | -------------------------------------------------------------------------------- | -| [`export alias`](/commands/docs/export_alias.md) | Builtin | Alias a command (with optional flags) to a new name and export it from a module. | -| [`export const`](/commands/docs/export_const.md) | Builtin | Use parse-time constant from a module and export them from this module. | -| [`export def`](/commands/docs/export_def.md) | Builtin | Define a custom command and export it from a module. | -| [`export extern`](/commands/docs/export_extern.md) | Builtin | Define an extern and export it from a module. | -| [`export module`](/commands/docs/export_module.md) | Builtin | Export a custom module from a module. | -| [`export use`](/commands/docs/export_use.md) | Builtin | Use definitions from a module and export them from this module. | \ No newline at end of file diff --git a/commands/docs/format.md b/commands/docs/format.md deleted file mode 100644 index 357aff7a5d3..00000000000 --- a/commands/docs/format.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: format -categories: | - strings -version: 0.90.0 -strings: | - Various commands for formatting data. -usage: | - Various commands for formatting data. -feature: default ---- - - -# {{ $frontmatter.title }} for strings - -
{{ $frontmatter.strings }}
- -## Signature - -```> format {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------------ | ------- | -------------------------------------------------------- | -| [`format date`](/commands/docs/format_date.md) | Builtin | Format a given date using a format string. | -| [`format duration`](/commands/docs/format_duration.md) | Builtin | Outputs duration with a specified unit of time. | -| [`format filesize`](/commands/docs/format_filesize.md) | Builtin | Converts a column of filesizes to some specified format. | -| [`format pattern`](/commands/docs/format_pattern.md) | Builtin | Format columns into a string using a simple pattern. | \ No newline at end of file diff --git a/commands/docs/from.md b/commands/docs/from.md deleted file mode 100644 index ab951ad8fdf..00000000000 --- a/commands/docs/from.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: from -categories: | - formats -version: 0.90.0 -formats: | - Parse a string or binary data into structured data. -usage: | - Parse a string or binary data into structured data. -feature: default ---- - - -# {{ $frontmatter.title }} for formats - -
{{ $frontmatter.formats }}
- -## Signature - -```> from {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------ | -------------- | -------------------------------------------------------------------------------------------------------------------------- | -| [`from csv`](/commands/docs/from_csv.md) | Builtin | Parse text as .csv and create table. | -| [`from eml`](/commands/docs/from_eml.md) | Builtin,Plugin | Parse text as .eml and create record. | -| [`from ics`](/commands/docs/from_ics.md) | Builtin,Plugin | Parse text as .ics and create table. | -| [`from ini`](/commands/docs/from_ini.md) | Builtin,Plugin | Parse text as .ini and create table. | -| [`from json`](/commands/docs/from_json.md) | Builtin | Convert from json to structured data. | -| [`from nuon`](/commands/docs/from_nuon.md) | Builtin | Convert from nuon to structured data. | -| [`from ods`](/commands/docs/from_ods.md) | Builtin | Parse OpenDocument Spreadsheet(.ods) data and create table. | -| [`from ssv`](/commands/docs/from_ssv.md) | Builtin | Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2. | -| [`from toml`](/commands/docs/from_toml.md) | Builtin | Parse text as .toml and create record. | -| [`from tsv`](/commands/docs/from_tsv.md) | Builtin | Parse text as .tsv and create table. | -| [`from url`](/commands/docs/from_url.md) | Builtin | Parse url-encoded string as a record. | -| [`from vcf`](/commands/docs/from_vcf.md) | Builtin,Plugin | Parse text as .vcf and create table. | -| [`from xlsx`](/commands/docs/from_xlsx.md) | Builtin | Parse binary Excel(.xlsx) data and create table. | -| [`from xml`](/commands/docs/from_xml.md) | Builtin | Parse text as .xml and create record. | -| [`from yaml`](/commands/docs/from_yaml.md) | Builtin | Parse text as .yaml/.yml and create table. | -| [`from yml`](/commands/docs/from_yml.md) | Builtin | Parse text as .yaml/.yml and create table. | \ No newline at end of file diff --git a/commands/docs/help.md b/commands/docs/help.md deleted file mode 100644 index d4f68cabc15..00000000000 --- a/commands/docs/help.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: help -categories: | - core -version: 0.90.0 -core: | - Display help information about different parts of Nushell. -usage: | - Display help information about different parts of Nushell. -feature: default ---- - - -# {{ $frontmatter.title }} for core - -
{{ $frontmatter.core }}
- -## Signature - -```> help {flags} ...rest``` - -## Flags - - - `--find, -f {string}`: string to find in command names, usage, and search terms - -## Parameters - - - `...rest`: The name of command, alias or module to get help on. - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | any | - -## Examples - -show help for single command, alias, or module -```nu -> help match - -``` - -show help for single sub-command, alias, or module -```nu -> help str lpad - -``` - -search for string in command names, usage and search terms -```nu -> help --find char - -``` - -## Notes -`help word` searches for "word" in commands, aliases and modules, in that order. - -## Subcommands: - -| name | type | usage | -| ---------------------------------------------------- | ------- | ------------------------------------ | -| [`help aliases`](/commands/docs/help_aliases.md) | Builtin | Show help on nushell aliases. | -| [`help commands`](/commands/docs/help_commands.md) | Builtin | Show help on nushell commands. | -| [`help escapes`](/commands/docs/help_escapes.md) | Builtin | Show help on nushell string escapes. | -| [`help externs`](/commands/docs/help_externs.md) | Builtin | Show help on nushell externs. | -| [`help modules`](/commands/docs/help_modules.md) | Builtin | Show help on nushell modules. | -| [`help operators`](/commands/docs/help_operators.md) | Builtin | Show help on nushell operators. | \ No newline at end of file diff --git a/commands/docs/http.md b/commands/docs/http.md deleted file mode 100644 index e43c799144e..00000000000 --- a/commands/docs/http.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: http -categories: | - network -version: 0.90.0 -network: | - Various commands for working with http methods. -usage: | - Various commands for working with http methods. -feature: default ---- - - -# {{ $frontmatter.title }} for network - -
{{ $frontmatter.network }}
- -## Signature - -```> http {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------ | ------- | --------------------------------------------------------- | -| [`http delete`](/commands/docs/http_delete.md) | Builtin | Delete the specified resource. | -| [`http get`](/commands/docs/http_get.md) | Builtin | Fetch the contents from a URL. | -| [`http head`](/commands/docs/http_head.md) | Builtin | Get the headers from a URL. | -| [`http options`](/commands/docs/http_options.md) | Builtin | Requests permitted communication options for a given URL. | -| [`http patch`](/commands/docs/http_patch.md) | Builtin | Patch a body to a URL. | -| [`http post`](/commands/docs/http_post.md) | Builtin | Post a body to a URL. | -| [`http put`](/commands/docs/http_put.md) | Builtin | Put a body to a URL. | \ No newline at end of file diff --git a/commands/docs/into.md b/commands/docs/into.md deleted file mode 100644 index d8f4554189e..00000000000 --- a/commands/docs/into.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: into -categories: | - conversions -version: 0.90.0 -conversions: | - Commands to convert data from one type to another. -usage: | - Commands to convert data from one type to another. -feature: default ---- - - -# {{ $frontmatter.title }} for conversions - -
{{ $frontmatter.conversions }}
- -## Signature - -```> into {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ---------------------------------------------------- | ------- | ------------------------------------------ | -| [`into binary`](/commands/docs/into_binary.md) | Builtin | Convert value to a binary primitive. | -| [`into bits`](/commands/docs/into_bits.md) | Builtin | Convert value to a binary primitive. | -| [`into bool`](/commands/docs/into_bool.md) | Builtin | Convert value to boolean. | -| [`into cell-path`](/commands/docs/into_cell-path.md) | Builtin | Convert value to a cell-path. | -| [`into datetime`](/commands/docs/into_datetime.md) | Builtin | Convert text or timestamp into a datetime. | -| [`into duration`](/commands/docs/into_duration.md) | Builtin | Convert value to duration. | -| [`into filesize`](/commands/docs/into_filesize.md) | Builtin | Convert value to filesize. | -| [`into float`](/commands/docs/into_float.md) | Builtin | Convert data into floating point number. | -| [`into int`](/commands/docs/into_int.md) | Builtin | Convert value to integer. | -| [`into record`](/commands/docs/into_record.md) | Builtin | Convert value to record. | -| [`into sqlite`](/commands/docs/into_sqlite.md) | Builtin | Convert table into a SQLite database. | -| [`into string`](/commands/docs/into_string.md) | Builtin | Convert value to string. | -| [`into value`](/commands/docs/into_value.md) | Builtin | Infer nushell datatype for each cell. | \ No newline at end of file diff --git a/commands/docs/keybindings.md b/commands/docs/keybindings.md deleted file mode 100644 index fb85b4ab2b7..00000000000 --- a/commands/docs/keybindings.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: keybindings -categories: | - platform -version: 0.90.0 -platform: | - Keybindings related commands. -usage: | - Keybindings related commands. -feature: default ---- - - -# {{ $frontmatter.title }} for platform - -
{{ $frontmatter.platform }}
- -## Signature - -```> keybindings {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -For more information on input and keybindings, check: - https://www.nushell.sh/book/line_editor.html - -## Subcommands: - -| name | type | usage | -| -------------------------------------------------------------- | ------- | -------------------------------------------------------------- | -| [`keybindings default`](/commands/docs/keybindings_default.md) | Builtin | List default keybindings. | -| [`keybindings list`](/commands/docs/keybindings_list.md) | Builtin | List available options that can be used to create keybindings. | -| [`keybindings listen`](/commands/docs/keybindings_listen.md) | Builtin | Get input from the user. | \ No newline at end of file diff --git a/commands/docs/math.md b/commands/docs/math.md deleted file mode 100644 index 039cd293a09..00000000000 --- a/commands/docs/math.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: math -categories: | - math -version: 0.90.0 -math: | - Use mathematical functions as aggregate functions on a list of numbers or tables. -usage: | - Use mathematical functions as aggregate functions on a list of numbers or tables. -feature: default ---- - - -# {{ $frontmatter.title }} for math - -
{{ $frontmatter.math }}
- -## Signature - -```> math {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| -------------------------------------------------- | ------- | ------------------------------------------------------------------------------------- | -| [`math abs`](/commands/docs/math_abs.md) | Builtin | Returns the absolute value of a number. | -| [`math arccos`](/commands/docs/math_arccos.md) | Builtin | Returns the arccosine of the number. | -| [`math arccosh`](/commands/docs/math_arccosh.md) | Builtin | Returns the inverse of the hyperbolic cosine function. | -| [`math arcsin`](/commands/docs/math_arcsin.md) | Builtin | Returns the arcsine of the number. | -| [`math arcsinh`](/commands/docs/math_arcsinh.md) | Builtin | Returns the inverse of the hyperbolic sine function. | -| [`math arctan`](/commands/docs/math_arctan.md) | Builtin | Returns the arctangent of the number. | -| [`math arctanh`](/commands/docs/math_arctanh.md) | Builtin | Returns the inverse of the hyperbolic tangent function. | -| [`math avg`](/commands/docs/math_avg.md) | Builtin | Returns the average of a list of numbers. | -| [`math ceil`](/commands/docs/math_ceil.md) | Builtin | Returns the ceil of a number (smallest integer greater than or equal to that number). | -| [`math cos`](/commands/docs/math_cos.md) | Builtin | Returns the cosine of the number. | -| [`math cosh`](/commands/docs/math_cosh.md) | Builtin | Returns the hyperbolic cosine of the number. | -| [`math exp`](/commands/docs/math_exp.md) | Builtin | Returns e raised to the power of x. | -| [`math floor`](/commands/docs/math_floor.md) | Builtin | Returns the floor of a number (largest integer less than or equal to that number). | -| [`math ln`](/commands/docs/math_ln.md) | Builtin | Returns the natural logarithm. Base: (math e). | -| [`math log`](/commands/docs/math_log.md) | Builtin | Returns the logarithm for an arbitrary base. | -| [`math max`](/commands/docs/math_max.md) | Builtin | Returns the maximum of a list of values, or of columns in a table. | -| [`math median`](/commands/docs/math_median.md) | Builtin | Computes the median of a list of numbers. | -| [`math min`](/commands/docs/math_min.md) | Builtin | Finds the minimum within a list of values or tables. | -| [`math mode`](/commands/docs/math_mode.md) | Builtin | Returns the most frequent element(s) from a list of numbers or tables. | -| [`math product`](/commands/docs/math_product.md) | Builtin | Returns the product of a list of numbers or the products of each column of a table. | -| [`math round`](/commands/docs/math_round.md) | Builtin | Returns the input number rounded to the specified precision. | -| [`math sin`](/commands/docs/math_sin.md) | Builtin | Returns the sine of the number. | -| [`math sinh`](/commands/docs/math_sinh.md) | Builtin | Returns the hyperbolic sine of the number. | -| [`math sqrt`](/commands/docs/math_sqrt.md) | Builtin | Returns the square root of the input number. | -| [`math stddev`](/commands/docs/math_stddev.md) | Builtin | Returns the standard deviation of a list of numbers, or of each column in a table. | -| [`math sum`](/commands/docs/math_sum.md) | Builtin | Returns the sum of a list of numbers or of each column in a table. | -| [`math tan`](/commands/docs/math_tan.md) | Builtin | Returns the tangent of the number. | -| [`math tanh`](/commands/docs/math_tanh.md) | Builtin | Returns the hyperbolic tangent of the number. | -| [`math variance`](/commands/docs/math_variance.md) | Builtin | Returns the variance of a list of numbers or of each column in a table. | \ No newline at end of file diff --git a/commands/docs/overlay.md b/commands/docs/overlay.md deleted file mode 100644 index e72d4da289c..00000000000 --- a/commands/docs/overlay.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: overlay -categories: | - core -version: 0.90.0 -core: | - Commands for manipulating overlays. -usage: | - Commands for manipulating overlays. -feature: default ---- - - -# {{ $frontmatter.title }} for core - -
{{ $frontmatter.core }}
- -## Signature - -```> overlay {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -This command is a parser keyword. For details, check: - https://www.nushell.sh/book/thinking_in_nu.html - - You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------ | ------- | -------------------------------------------- | -| [`overlay hide`](/commands/docs/overlay_hide.md) | Builtin | Hide an active overlay. | -| [`overlay list`](/commands/docs/overlay_list.md) | Builtin | List all active overlays. | -| [`overlay new`](/commands/docs/overlay_new.md) | Builtin | Create an empty overlay. | -| [`overlay use`](/commands/docs/overlay_use.md) | Builtin | Use definitions from a module as an overlay. | \ No newline at end of file diff --git a/commands/docs/path.md b/commands/docs/path.md deleted file mode 100644 index cebdcefafef..00000000000 --- a/commands/docs/path.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: path -categories: | - path -version: 0.90.0 -path: | - Explore and manipulate paths. -usage: | - Explore and manipulate paths. -feature: default ---- - - -# {{ $frontmatter.title }} for path - -
{{ $frontmatter.path }}
- -## Signature - -```> path {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -There are three ways to represent a path: - -* As a path literal, e.g., '/home/viking/spam.txt' -* As a structured path: a table with 'parent', 'stem', and 'extension' (and -* 'prefix' on Windows) columns. This format is produced by the 'path parse' - subcommand. -* As a list of path parts, e.g., '[ / home viking spam.txt ]'. Splitting into - parts is done by the `path split` command. - -All subcommands accept all three variants as an input. Furthermore, the 'path -join' subcommand can be used to join the structured path or path parts back into -the path literal. - -## Subcommands: - -| name | type | usage | -| -------------------------------------------------------- | ------- | ----------------------------------------------------------------------- | -| [`path basename`](/commands/docs/path_basename.md) | Builtin | Get the final component of a path. | -| [`path dirname`](/commands/docs/path_dirname.md) | Builtin | Get the parent directory of a path. | -| [`path exists`](/commands/docs/path_exists.md) | Builtin | Check whether a path exists. | -| [`path expand`](/commands/docs/path_expand.md) | Builtin | Try to expand a path to its absolute form. | -| [`path join`](/commands/docs/path_join.md) | Builtin | Join a structured path or a list of path parts. | -| [`path parse`](/commands/docs/path_parse.md) | Builtin | Convert a path into structured data. | -| [`path relative-to`](/commands/docs/path_relative-to.md) | Builtin | Express a path as relative to another path. | -| [`path split`](/commands/docs/path_split.md) | Builtin | Split a path into a list based on the system's path separator. | -| [`path type`](/commands/docs/path_type.md) | Builtin | Get the type of the object a path refers to (e.g., file, dir, symlink). | \ No newline at end of file diff --git a/commands/docs/query.md b/commands/docs/query.md deleted file mode 100644 index b8c2c28d487..00000000000 --- a/commands/docs/query.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: query -categories: | - filters -version: 0.90.0 -filters: | - Show all the query commands -usage: | - Show all the query commands -feature: default ---- - - -# {{ $frontmatter.title }} for filters - -
{{ $frontmatter.filters }}
- -## Signature - -```> query {flags} ``` - - -## Input/output types: - -| input | output | -| ----- | ------ | -| any | any | - - -## Subcommands: - -| name | type | usage | -| -------------------------------------------- | -------------- | --------------------------------------------------------------------------------- | -| [`query db`](/commands/docs/query_db.md) | Builtin | Query a database using SQL. | -| [`query json`](/commands/docs/query_json.md) | Builtin,Plugin | execute json query on json file (open --raw \ | query json 'query string') | -| [`query web`](/commands/docs/query_web.md) | Builtin,Plugin | execute selector query on html/web | -| [`query xml`](/commands/docs/query_xml.md) | Builtin,Plugin | execute xpath query on xml | \ No newline at end of file diff --git a/commands/docs/random.md b/commands/docs/random.md deleted file mode 100644 index d3c56d23cc3..00000000000 --- a/commands/docs/random.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: random -categories: | - random -version: 0.90.0 -random: | - Generate a random value. -usage: | - Generate a random value. -feature: default ---- - - -# {{ $frontmatter.title }} for random - -
{{ $frontmatter.random }}
- -## Signature - -```> random {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------ | ------- | -------------------------------------------------- | -| [`random bool`](/commands/docs/random_bool.md) | Builtin | Generate a random boolean value. | -| [`random chars`](/commands/docs/random_chars.md) | Builtin | Generate random chars. | -| [`random dice`](/commands/docs/random_dice.md) | Builtin | Generate a random dice roll. | -| [`random float`](/commands/docs/random_float.md) | Builtin | Generate a random float within a range [min..max]. | -| [`random int`](/commands/docs/random_int.md) | Builtin | Generate a random integer [min..max]. | -| [`random uuid`](/commands/docs/random_uuid.md) | Builtin | Generate a random uuid4 string. | \ No newline at end of file diff --git a/commands/docs/roll.md b/commands/docs/roll.md deleted file mode 100644 index 0f7c73a0d85..00000000000 --- a/commands/docs/roll.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: roll -categories: | - filters -version: 0.90.0 -filters: | - Rolling commands for tables. -usage: | - Rolling commands for tables. -feature: extra ---- - - -# {{ $frontmatter.title }} for filters - -
{{ $frontmatter.filters }}
- - -::: warning - Command `roll` was not included in the official binaries by default, you have to build it with `--features=extra` flag -::: -## Signature - -```> roll {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| -------------------------------------------- | ------- | ---------------------------------- | -| [`roll down`](/commands/docs/roll_down.md) | Builtin | Roll table rows down. | -| [`roll left`](/commands/docs/roll_left.md) | Builtin | Roll record or table columns left. | -| [`roll right`](/commands/docs/roll_right.md) | Builtin | Roll table columns right. | -| [`roll up`](/commands/docs/roll_up.md) | Builtin | Roll table rows up. | \ No newline at end of file diff --git a/commands/docs/scope.md b/commands/docs/scope.md deleted file mode 100644 index 545c01293c5..00000000000 --- a/commands/docs/scope.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: scope -categories: | - core -version: 0.90.0 -core: | - Commands for getting info about what is in scope. -usage: | - Commands for getting info about what is in scope. -feature: default ---- - - -# {{ $frontmatter.title }} for core - -
{{ $frontmatter.core }}
- -## Signature - -```> scope {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------------------ | ------- | -------------------------------------------------------- | -| [`scope aliases`](/commands/docs/scope_aliases.md) | Builtin | Output info on the aliases in the current scope. | -| [`scope commands`](/commands/docs/scope_commands.md) | Builtin | Output info on the commands in the current scope. | -| [`scope engine-stats`](/commands/docs/scope_engine-stats.md) | Builtin | Output stats on the engine in the current state. | -| [`scope externs`](/commands/docs/scope_externs.md) | Builtin | Output info on the known externals in the current scope. | -| [`scope modules`](/commands/docs/scope_modules.md) | Builtin | Output info on the modules in the current scope. | -| [`scope variables`](/commands/docs/scope_variables.md) | Builtin | Output info on the variables in the current scope. | \ No newline at end of file diff --git a/commands/docs/split.md b/commands/docs/split.md deleted file mode 100644 index e8c807fd919..00000000000 --- a/commands/docs/split.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: split -categories: | - strings -version: 0.90.0 -strings: | - Split contents across desired subcommand (like row, column) via the separator. -usage: | - Split contents across desired subcommand (like row, column) via the separator. -feature: default ---- - - -# {{ $frontmatter.title }} for strings - -
{{ $frontmatter.strings }}
- -## Signature - -```> split {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------ | ------- | ------------------------------------------------------- | -| [`split chars`](/commands/docs/split_chars.md) | Builtin | Split a string into a list of characters. | -| [`split column`](/commands/docs/split_column.md) | Builtin | Split a string into multiple columns using a separator. | -| [`split list`](/commands/docs/split_list.md) | Builtin | Split a list into multiple lists using a separator. | -| [`split row`](/commands/docs/split_row.md) | Builtin | Split a string into multiple rows using a separator. | -| [`split words`](/commands/docs/split_words.md) | Builtin | Split a string's words into separate rows. | \ No newline at end of file diff --git a/commands/docs/stor.md b/commands/docs/stor.md deleted file mode 100644 index 7159d39922c..00000000000 --- a/commands/docs/stor.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: stor -categories: | - database -version: 0.90.0 -database: | - Various commands for working with the in-memory sqlite database. -usage: | - Various commands for working with the in-memory sqlite database. -feature: default ---- - - -# {{ $frontmatter.title }} for database - -
{{ $frontmatter.database }}
- -## Signature - -```> stor {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ---------------------------------------------- | ------- | --------------------------------------------------------------------------- | -| [`stor create`](/commands/docs/stor_create.md) | Builtin | Create a table in the in-memory sqlite database. | -| [`stor delete`](/commands/docs/stor_delete.md) | Builtin | Delete a table or specified rows in the in-memory sqlite database. | -| [`stor export`](/commands/docs/stor_export.md) | Builtin | Export the in-memory sqlite database to a sqlite database file. | -| [`stor import`](/commands/docs/stor_import.md) | Builtin | Import a sqlite database file into the in-memory sqlite database. | -| [`stor insert`](/commands/docs/stor_insert.md) | Builtin | Insert information into a specified table in the in-memory sqlite database. | -| [`stor open`](/commands/docs/stor_open.md) | Builtin | Opens the in-memory sqlite database. | -| [`stor reset`](/commands/docs/stor_reset.md) | Builtin | Reset the in-memory database by dropping all tables. | -| [`stor update`](/commands/docs/stor_update.md) | Builtin | Update information in a specified table in the in-memory sqlite database. | \ No newline at end of file diff --git a/commands/docs/str.md b/commands/docs/str.md deleted file mode 100644 index e02b3674369..00000000000 --- a/commands/docs/str.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: str -categories: | - strings -version: 0.90.0 -strings: | - Various commands for working with string data. -usage: | - Various commands for working with string data. -feature: extra ---- - - -# {{ $frontmatter.title }} for strings - -
{{ $frontmatter.strings }}
- - -::: warning - Command `str` was not included in the official binaries by default, you have to build it with `--features=extra` flag -::: -## Signature - -```> str {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| [`str camel-case`](/commands/docs/str_camel-case.md) | Builtin | Convert a string to camelCase. | -| [`str capitalize`](/commands/docs/str_capitalize.md) | Builtin | Capitalize first letter of text. | -| [`str contains`](/commands/docs/str_contains.md) | Builtin | Checks if string input contains a substring. | -| [`str distance`](/commands/docs/str_distance.md) | Builtin | Compare two strings and return the edit distance/Levenshtein distance. | -| [`str downcase`](/commands/docs/str_downcase.md) | Builtin | Make text lowercase. | -| [`str ends-with`](/commands/docs/str_ends-with.md) | Builtin | Check if an input ends with a string. | -| [`str escape-glob`](/commands/docs/str_escape-glob.md) | Builtin | Escape glob pattern. | -| [`str expand`](/commands/docs/str_expand.md) | Builtin | Generates all possible combinations defined in brace expansion syntax. | -| [`str index-of`](/commands/docs/str_index-of.md) | Builtin | Returns start index of first occurrence of string in input, or -1 if no match. | -| [`str join`](/commands/docs/str_join.md) | Builtin | Concatenate multiple strings into a single string, with an optional separator between each. | -| [`str kebab-case`](/commands/docs/str_kebab-case.md) | Builtin | Convert a string to kebab-case. | -| [`str length`](/commands/docs/str_length.md) | Builtin | Output the length of any strings in the pipeline. | -| [`str pascal-case`](/commands/docs/str_pascal-case.md) | Builtin | Convert a string to PascalCase. | -| [`str replace`](/commands/docs/str_replace.md) | Builtin | Find and replace text. | -| [`str reverse`](/commands/docs/str_reverse.md) | Builtin | Reverse every string in the pipeline. | -| [`str screaming-snake-case`](/commands/docs/str_screaming-snake-case.md) | Builtin | Convert a string to SCREAMING_SNAKE_CASE. | -| [`str snake-case`](/commands/docs/str_snake-case.md) | Builtin | Convert a string to snake_case. | -| [`str starts-with`](/commands/docs/str_starts-with.md) | Builtin | Check if an input starts with a string. | -| [`str stats`](/commands/docs/str_stats.md) | Builtin | Gather word count statistics on the text. | -| [`str substring`](/commands/docs/str_substring.md) | Builtin | Get part of a string. Note that the start is included but the end is excluded, and that the first character of a string is index 0. | -| [`str title-case`](/commands/docs/str_title-case.md) | Builtin | Convert a string to Title Case. | -| [`str trim`](/commands/docs/str_trim.md) | Builtin | Trim whitespace or specific character. | -| [`str upcase`](/commands/docs/str_upcase.md) | Builtin | Make text uppercase. | \ No newline at end of file diff --git a/commands/docs/to.md b/commands/docs/to.md deleted file mode 100644 index 3fb51f1e063..00000000000 --- a/commands/docs/to.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: to -categories: | - formats -version: 0.90.0 -formats: | - Translate structured data to a format. -usage: | - Translate structured data to a format. -feature: default ---- - - -# {{ $frontmatter.title }} for formats - -
{{ $frontmatter.formats }}
- -## Signature - -```> to {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| -------------------------------------- | ------- | ------------------------------------------------------------- | -| [`to csv`](/commands/docs/to_csv.md) | Builtin | Convert table into .csv text . | -| [`to html`](/commands/docs/to_html.md) | Builtin | Convert table into simple HTML. | -| [`to json`](/commands/docs/to_json.md) | Builtin | Converts table data into JSON text. | -| [`to md`](/commands/docs/to_md.md) | Builtin | Convert table into simple Markdown. | -| [`to nuon`](/commands/docs/to_nuon.md) | Builtin | Converts table data into Nuon (Nushell Object Notation) text. | -| [`to text`](/commands/docs/to_text.md) | Builtin | Converts data into simple text. | -| [`to toml`](/commands/docs/to_toml.md) | Builtin | Convert record into .toml text. | -| [`to tsv`](/commands/docs/to_tsv.md) | Builtin | Convert table into .tsv text. | -| [`to xml`](/commands/docs/to_xml.md) | Builtin | Convert special record structure into .xml text. | -| [`to yaml`](/commands/docs/to_yaml.md) | Builtin | Convert table into .yaml/.yml text. | \ No newline at end of file diff --git a/commands/docs/url.md b/commands/docs/url.md deleted file mode 100644 index c7211688283..00000000000 --- a/commands/docs/url.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: url -categories: | - network -version: 0.90.0 -network: | - Various commands for working with URLs. -usage: | - Various commands for working with URLs. -feature: default ---- - - -# {{ $frontmatter.title }} for network - -
{{ $frontmatter.network }}
- -## Signature - -```> url {flags} ``` - - -## Input/output types: - -| input | output | -| ------- | ------ | -| nothing | string | - -## Notes -You must use one of the following subcommands. Using this command as-is will only produce this help message. - -## Subcommands: - -| name | type | usage | -| ------------------------------------------------------ | ------- | --------------------------------------------------------------------- | -| [`url build-query`](/commands/docs/url_build-query.md) | Builtin | Converts record or table into query string applying percent-encoding. | -| [`url decode`](/commands/docs/url_decode.md) | Builtin | Converts a percent-encoded web safe string to a string. | -| [`url encode`](/commands/docs/url_encode.md) | Builtin | Converts a string to a percent encoded web safe string. | -| [`url join`](/commands/docs/url_join.md) | Builtin | Converts a record to url. | -| [`url parse`](/commands/docs/url_parse.md) | Builtin | Parses a url. | \ No newline at end of file diff --git a/cookbook/help.md b/cookbook/help.md deleted file mode 100644 index 473f0dc2cbf..00000000000 --- a/cookbook/help.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: Help ---- - -# Help - -The `help` command is a good way to become familiar with all that Nu has to offer. - -### How to see all supported commands: - -```nu -help commands -``` - ---- - -### Specific information on a command - -To find more specific information on a command, use `help `. This works for regular commands (i.e. `http`) and subcommands (i.e. `http get`): - -```nu -help http get -``` - -Output: - -``` -Fetch the contents from a URL. - -Performs HTTP GET operation. - -Search terms: network, fetch, pull, request, download, curl, wget - -Usage: - > http get {flags} - -Flags: - -h, --help - Display the help message for this command - -u, --user - the username when authenticating - -p, --password - the password when authenticating - -t, --timeout - timeout period in seconds - -H, --headers - custom headers you want to add - -r, --raw - fetch contents as text rather than a table - -Signatures: - | http get -> - -Parameters: - URL : the URL to fetch the contents from - -Examples: - http get content from example.com - > http get https://www.example.com - - http get content from example.com, with username and password - > http get -u myuser -p mypass https://www.example.com - - http get content from example.com, with custom header - > http get -H [my-header-key my-header-value] https://www.example.com -``` diff --git a/de/README.md b/de/README.md deleted file mode 100644 index 7dcf446501c..00000000000 --- a/de/README.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -home: true -heroImage: null -heroText: Nushell -tagline: Eine neue Art von Shell. -actionText: Loslegen → -actionLink: /de/book/ -features: - - title: Pipelines um jedes Betriebssystem zu steuern - details: Nu läuft auf Linux, macOS und Windows. Einmal lernen - überall verwenden. - - title: Alles sind Daten. - details: Pipelines in Nu nutzen strukturierte Daten die einfach ausgewählt, gefiltert und sortiert werden können. Nie wieder Strings parsen, sondern direkt anfangen Probleme zu lösen. - - title: Leistungsfähige Plugins - details: Nu kann dank des leistungsfähigen Plugin-Systems einfach erweitert werden. ---- - -Screenshot zeigt die Verwendung des ls-Befehls - -### Nu funktioniert mit existierenden Daten - -Nu versteht [JSON, YAML, XML, Excel und noch mehr](/book/loading_data.md). Es ist einfach Daten in eine Nu Pipeline zu laden ganz egal ob diese in einer Datei, einer Datenbank oder einer Web-API liegen: - -Screenshot zeigt das Laden von Daten von einer Web-API - -### Nu hat tolle Fehlermeldungen - -Nu arbeitet mit typisierten Daten, wodurch Fehler abgefangen werden, die andere Shells nicht erkennen. Und falls etwas schiefgeht bekommt genau mitgeteilt wo und weshalb: - -Screenshot zeigt eine Fehlermeldung, wenn Nu einen type error abfängt - -## Nu installieren - -Nushell ist verfügbar [als kompiliertes Programm](https://github.com/nushell/nushell/releases), [von einem Packetmanager](https://repology.org/project/nushell/versions), und als [Source Code](https://github.com/nushell/nushell). Die detaillierten Installationsanweisungen sind [hier](/de/book/installation.md) zu finden. Oder direkt loslegen: - -#### macOS / Linux: - -```sh -$ brew install nushell -``` - -#### Windows: - -```powershell -$ winget install nushell -``` - -## Community - -Wenn es irgendwelche Fragen gibt, am besten unserem (englischsprachigen) [Discord Server](https://discord.gg/NtAbbGn) beitreten. Dort gibt es sehr viele Menschen die gerne weiterhelfen ganz egal ob man neu zu Nu ist oder nicht. - -Dazu beitragen diese Seiten zu verbessern durch [Feedback](https://github.com/nushell/nushell.github.io/issues) oder eine [Pull Request](https://github.com/nushell/nushell.github.io/pulls). diff --git a/de/book/coming_from_bash.md b/de/book/coming_from_bash.md deleted file mode 100644 index 5988fc381f3..00000000000 --- a/de/book/coming_from_bash.md +++ /dev/null @@ -1,51 +0,0 @@ -# Vergleich zu Bash - -Hinweis: Diese Tabelle geht von Nu 0.59 oder neuer aus. - -| Bash | Nu | Funktion | -| ------------------------------------ | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | -| `ls` | `ls` | Auflisten der Dateien des aktuellen Pfads | -| `ls ` | `ls ` | Auflisten der Dateien am angegebenen Pfad | -| `ls pattern*` | `ls pattern*` | Auflisten von Dateien, die dem gegebenen Schema/Pattern folgen | -| `ls -la` | `ls --long --all` or `ls -la` | Auflisten aller Dateien (inklusive versteckte) mit allen verfügbaren Informationen | -| `ls -d */` | `ls \| where type == Dir` | Auflisten von Ordnern | -| `find . -name *.rs` | `ls **/*.rs` | Rekursives auflisten aller Dateien, die zum gegebenen Schema/Pattern passen | -| `cd ` | `cd ` | Wechseln an den angegebenen Pfad | -| `cd` | `cd` | Wechseln in den HOME-Ordner | -| `cd -` | `cd -` | Wechseln an den vorherigen Pfad | -| `mkdir ` | `mkdir ` | Erzeugen des angegebenen Pfads | -| `mkdir -p ` | `mkdir ` | Erzeugen des angegebenen Pfads und weiterer Ordner wenn nötig | -| `touch test.txt` | `touch test.txt` | Erstellen einer Datei | -| `> ` | `\| save ` | Speichern eines String in eine Datei | -| `>> ` | `\| save --append ` | Anhängen eines Strings an eine Datei | -| `cat ` | `open --raw ` | Einlesen des Inhalts der angegebenen Datei (in Textform) | -| | `open ` | Einlesen einer Datei in Form von strukturierten Daten | -| `mv ` | `mv ` | Bewegen einer Datei an einen neuen Ort | -| `cp ` | `cp ` | Kopieren einer Datei an einen Ort | -| `cp -r ` | `cp -r ` | Kopieren eines Ordners an einen Ort (rekursiv) | -| `rm ` | `rm ` | Entfernen der angegebenen Datei | -| | `rm -t ` | Angegebene Datei in den Papierkorb des Systems werfen | -| `rm -rf ` | `rm -r ` | Entfernen des angegebenen Pfads rekursiv | -| `chmod` | `` | Ändern von Dateiattributen | -| `date -d ` | `"" \| into datetime -f ` | Datum ausgeben ([Dokumentation des Formats](https://docs.rs/chrono/0.4.15/chrono/format/strftime/index.html)) | -| `sed` | `str find-replace` | Suchen und ersetzen eines Pattern in einem String | -| `grep ` | `where $it =~ ` or `find ` | Filtern von Strings die den Substring beinhalten | -| `man ` | `help ` | Hilfe zu einem Befehl ansehen | -| | `help commands` | Alle verfügbaren Befehle anzeigen | -| | `help --find ` | Nach einem Text in allen verfügbaren Befehlen suchen | -| `command1 && command2` | `command1; command2` | Ausführen eines Befehls und wenn Ausführung erfolgreich wird ein weiterer Befehl ausgeführt | -| `stat $(which git)` | `stat (which git).path` | Ausgabe eines Befehls als Eingabe für einen anderen Befehl verwenden | -| `echo $PATH` | `echo $env.PATH` | Aktuelle PATH-Variable anzeigen | -| `` | `vim $nu.config-path` | PATH permanent ändern | -| `export PATH = $PATH:/usr/other/bin` | `$env.PATH = ($env.PATH \| append /usr/other/bin)` | PATH temporär ändern | -| `export` | `echo $env` | Anzeigen der aktuellen Umgebungsvariablen | -| `` | `vim $nu.config-path` | Umgebungsvariablen permanent ändern | -| `FOO=BAR ./bin` | `FOO=BAR ./bin` | Umgebungsvariablen temporär ändern | -| `export FOO=BAR` | `$env.FOO = BAR` | Umgebungsvariable für aktuelle Sitzung setzen | -| `echo $FOO` | `echo $env.FOO` | Umgebungsvariablen nutzen | -| `unset FOO` | `hide FOO` | Umgebungsvariable für aktuelle Sitzung verbergen | -| `alias s="git status -sb"` | `alias s = git status -sb` | Alias temporär definieren | -| `` | `vim $nu.config-path` | Alias permanent hinzufügen und ändern (für neue Shells) | -| `bash -c ` | `nu -c ` | Ausführen einer Pipeline an Befehlen (benötigt 0.9.1 oder neuer) | -| `bash