get_ordered_context_list - Linux


Overview

get_ordered_context_list is a command that returns a sorted list of contexts surrounding the current context. It can be used to understand the hierarchical structure of contexts in the system and to navigate between them.

Syntax

get_ordered_context_list [options] [<context> [<depth>]]

Options/Flags

  • -h, –help: Display help and usage information.
  • -d, –depth: Specify the depth of the traversal. Default: 1
  • -a, –all: Include all contexts in the list, including child and ancestor contexts.

Examples

  • List the closest parent and child contexts of the current context:
get_ordered_context_list
  • List the parent context and its siblings:
get_ordered_context_list -d 2
  • List all contexts in the system:
get_ordered_context_list -a

Common Issues

  • Context not found: The specified context may not exist. Ensure that the context name is correct.
  • Invalid depth: The depth must be a positive integer.

Integration

get_ordered_context_list can be used with the set_context command to navigate between contexts:

get_ordered_context_list
set_context <new_context>

Related Commands

  • get_context: Get the current context.
  • set_context: Set the current context.
  • context_help: Display help for contexts.