Coder Social home page Coder Social logo

cmps's Introduction

CMPS

An intelligent touch!

cmps is short for compose, an extendable cross-platform CLI tool to create or fill files with a default content.

Usage

cmps [OPTIONS] [FILENAME] [EXTENSION]

Arguments:
  [FILENAME]
          The filename to compose, may point to a non-existing file, or an empty existing file

  [EXTENSION]
          The extension to use, overrides the extension in the filename (if any)

Options:
      --show <extension>
          Show the template for this extension and the path to the source file

      --stdout
          Write the template for this file to stdout. Does not create or modify the file.

          Useful for integrating with editors like (Neo-)vim.

  -f, --force
          Overwrite existing files. This will clear the file contents if no template is found

  -v, --verbose...
          Sets the level of verbosity (provide multiple times for higher levels)

  -h, --help
          Print help information (use `-h` for a summary)

  -V, --version
          Print version information

Custom templates can be placed in your config directory (see https://docs.rs/dirs/latest/dirs/fn.config_dir.html for platform specific details) under cmps/templates. The name of the template file must match the file extension to be modified.

E.g. creating a file cmps/templates/py with the contents

#!/usr/bin/env python3
# Author: John Doe

will insert the shebang and the author name when creating python files with compose.

Local (per-project) configuration

If you want to use different templates for a specific project, you can create a .cmps directory to add additional templates or overwrite existing ones. A good use-case for this is if you want to automatically insert a specific license in one of your projects, but not everywhere.

Like in the config directory, templates must be placed under a templates subfolder in this .cmps directory.

E.g.: /my/important/project/.cmps/templates/py would overwrite the template used for python files in the /my/important/project/ directory and its subdirectories.

Authors

Björn Daase and Leon Matthes

cmps's People

Contributors

bdaase avatar brauntom avatar leonmatthes avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

brauntom

cmps's Issues

Open created files

Add a command line flag to open the files you created with the tool with the standard tool the platform/user has for the special file extension

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.