Giter VIP home page Giter VIP logo

exitcodegenerator's Introduction

Exit Code Generator

Tool to sleep for a given amount of milliseconds and then return a given exit code.

Download latest executable

Introduction

This is a small Windows command line utility to sleep for a given amount of milliseconds and then return a given exit code.

It is intended as a mockup for testing external application calls.

E.g. I'm using it in testing an application of mine that calls an external command line virus scanner, that takes some time to run and returns different exit codes depending on whether a virus was detected or not. Instead of specifying the actual virus scanner on our test machines, I simply call the exitcode-generator.exe with different parameters.

Usage

exitcode-generator.exe 
    [--exitcode=<code>] 
    [--sleep=<milliseconds>] 
    [--log=<true|false>] 
    [--keeplogfiles=<true|false>] 
    [--quiet=<true|false>]

(Multi-line for illustration purposes only; call as a single line in real life).

Command line arguments

--exitcode=<code>:

Optional. Specify an integer exit code, positive or negative or zero to return from the application. If none is specified, zero is returned.

--sleep=<milliseconds>:

Optional. Specify a positive amount of milliseconds to sleep before exiting. If none is specified, the application returns immediately.

--log=<true|false>:

Optional. Specify whether to log to a file at all. If not specified, the default value is false.

--keeplogfile=<true|false>:

Optional. Specify whether to clear any existing log file upon program start. If not specified, the default value is true. Useful for calling the program multiple times and having one large cumulated log file.

--quiet=<true|false>:

Optional. Specify whether to output anything to the console at all. If not specified, the default value is false, meaning it does output text.

Examples

Immediately return exit code -2:

exitcode-generator.exe --exitcode=-2

Wait for 2 seconds and then return exit code 5:

exitcode-generator.exe --sleep=2000 --exitcode=5

Wait for 3.5 seconds and then return exit code 0:

exitcode-generator.exe --sleep=3500

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.