argparse

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package argparse splits payload metadata strings into tokens with shell-style quoting so values containing spaces (passwords, etc.) survive intact.

Rules:

  • whitespace (space/tab) separates tokens
  • 'single-quoted' preserves every byte literally until the next '
  • "double-quoted" preserves bytes, but \\ and \" are unescaped
  • \X outside any quote yields X (including \ to quote a space)
  • unterminated quotes extend to end of input (lenient, matches user intent)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Split

func Split(s string) []string

Split parses s into argv.

func SplitN

func SplitN(s string, n int) []string

SplitN behaves like Split but stops after the first n-1 tokens, returning the remainder as the last element verbatim (no further quote handling). Useful when the last argument is an opaque blob (e.g. base64-encoded command).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL