Git Product home page Git Product logo

unmagicalstrings's Introduction

UnMagicalStrings

Make your resources type safe and IntelliSense friendly

Getting Started

Prerequisities

.NETFramework v4.5+

Installing

Just copy ums.exe to a folder in your path

Usage

  • -t or -target or first argument: the output file name or location (e.g. MyResources.cs). If not specified, the console stdout is used.
  • -s or -source: the base directory to scan for files. If not specified, the current working directory is used.
  • -n or -namespace: the namespace for the resources class.
  • -i or -include: the patterns of files and folders to should be included relative to the base directory.
  • -e or -exclude: the patterns of files and folders to should be excluded relative to the base directory.

The pattern matching style can be exact or partial, using * syntax (e.g. file.ext, folder*, folder\subfolder*, *file*, *.ext)

Samples

Sample folder structure:

  • description.txt
  • images
    • image.bmp
    • image.gif
  • styles
    • main.css
    • colors.css
    • headers.css
  • scripts
    • main.js

Scan all files and folders in the current location:

C:\demo>ums.exe
public partial class Resources
{
    public const string description_txt = @"description.txt";
    public const string imagesFolder = @"images\";
    public partial class images
    {
        public const string image_bmp = @"images\image.bmp";
        public const string image_gif = @"images\image.gif";
    }
    public const string scriptsFolder = @"scripts\";
    public partial class scripts
    {
        public const string main_js = @"scripts\main.js";
    }
    public const string stylesFolder = @"styles\";
    public partial class styles
    {
        public const string colors_css = @"styles\colors.css";
        public const string headers_css = @"styles\headers.css";
        public const string main_css = @"styles\main.css";
    }
}

Specify target, namespace, include and exclude patterns:

C:\demo>ums.exe MyResources -namespace MyNamespace -include images* -exclude *.gif
namespace MyNamespace
{
    public partial class Resources
    {
        public const string imagesFolder = @"images\";
        public partial class images
        {
            public const string image_bmp = @"images\image.bmp";
        }
    }
}

Questions, Issues and Contributing

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

unmagicalstrings's People

Contributors

marcosbozzani avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.