New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cmdt

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmdt

Command-line tool for testing command-line tools

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32
decreased by-30.43%
Maintainers
1
Weekly downloads
 
Created
Source
Avatar

Build Status Dependencies Status Published Version
npm Badge

Cmdt

Cmdt is a command-line tool for testing command-line tools.

This is handy for testing a command line execution result by checking its exit code and output. Commands will be executed in a temporary directory /tmp/cmdt--/ , this directory will be removed after all tests are completed unless -d/--debug flag is specified.

Installation

npm install -g cmdt

Usage

Run tests on specified .cmdt files:

cmdt run <file1>.cmdt <file2>.cmdt

Run all .cmdt test files contained in a directory:

cmdt run <dir>

Debug exit code and output of failing tests, temporary directory will be logged and won't be removed at the end of the execution:

cmdt run --debug <file>.cmdt <dir>

Test File

Set test command, expected exit code and/or output regular expression in a .cmdt file:

command: whoami
exitcode: 0
output: someuser

command: time
exitcode: 0
output: real.+user.+sys.+

command: unknowncommand
exitcode: 1
output: ^some error$

Fields

NameDescriptionMandatory
descriptionthe description of the testNo
commandthe command line to be executedYes
exitcodethe expected exit codeNo
outputthe stdout + stderr output, supports regexp matchingNo

Keywords

FAQs

Package last updated on 15 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc