ls

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cli.Command{
	Name:  "ls",
	Usage: "List directory contents",
	Flags: []cli.Flag{
		&cli.BoolFlag{Name: "long, l", Usage: "Long listing format"},
		&cli.BoolFlag{Name: "all, a", Usage: "Include hidden files"},
	},
	Action: func(ctx context.Context, cmd *cli.Command) error {
		long := cmd.Bool("long")
		all := cmd.Bool("all")

		files := cmd.Args().Slice()
		if len(files) == 0 {
			files = []string{"."}
		}

		for _, file := range files {
			if long {
				listLong(file, all)
			} else {
				listShort(file, all)
			}
		}
		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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