{"version":"2.1.227","anchor":"slash-commands-can-restrict-subcommands-to-bare-invocations","canonical_anchor":"slash-commands-can-restrict-subcommands-to-bare-invocations","heading":"Slash commands can restrict subcommands to bare invocations","tier":"use","area":"Slash Commands","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.227\/e\/slash-commands-can-restrict-subcommands-to-bare-invocations","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.227","markdown":"### Slash commands can restrict subcommands to bare invocations\n\nCustom commands can mark subcommands bare-only, so extra words go to the parent command.\n\n**What**\n\nCommand definitions gained a `subcommandsBareOnly` field. When it is set, a subcommand name only matches if nothing follows it, so typing `\/foo bar baz` runs the parent `\/foo` command with `bar baz` as its arguments instead of dispatching to the `bar` subcommand.\n\n**Details**\n\n- Carried through both prompt-backed and file-backed command construction, and added to the allow-list used when commands are serialized.\n- Dispatch bails out on trailing text: `if (e.subcommandsBareOnly && s !== \"\") return;`.\n- The field did not exist in v2.1.226.\n\n**Evidence**\n\n`if (e.subcommandsBareOnly && s !== \"\") return;`, `subcommandsBareOnly`\n\n- Area: Slash Commands\n- Names: `subcommandsBareOnly`\n- Tier: Use it now\n- Useful: 2\/5\n- Signal: 2\/5"}