Idk. Simple argument parser for u. Probably needs some changes xd

Overview

SimpleArgumentParser


Maven

<repositories>
	<repository>
	    <id>jitpack.io</id>
	    <url>https://jitpack.io</url>
	</repository>
</repositories>
<dependencies>
	<dependency>
	    <groupId>com.github.narumii</groupId>
	    <artifactId>SimpleArgumentParser</artifactId>
	    <version>LATEST</version>
	</dependency>
</dependencies>
  • Latest: 1.0

Example

import uwu.narumi.argparser.ArgumentParser;
import uwu.narumi.argparser.option.Options;
import uwu.narumi.argparser.rules.Rules;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class Example {

    private static final ArgumentParser argumentParser = ArgumentParser.builder().build();

    //java -jar application.jar -dir example/dir -fileName example.txt +create
    //java -jar application.jar -dir example/dir -fileName example.txt
    public static void main(String... args) throws IOException {
        Options options = argumentParser.parse(
                Rules.builder()
                        .add("dir", false, true)
                        .add("fileName", false, true)
                        .add("create", true, false)
                        .build(),
                args
        );

        System.out.println(options);
        Path dir = Paths.get(options.asString("dir").get());
        if (!dir.toFile().exists())
            dir.toFile().mkdirs();

        Path file = Paths.get(dir.toString(), options.asString("fileName").get());
        if (options.asBoolean("create").orElse(false) && !file.toFile().exists()) {
            file.toFile().createNewFile();
            System.out.println("Created: " + file);
        }

        System.out.println("Written bytes to: " + Files.write(file, new byte[]{1, 2, 3}));
    }
}
You might also like...

QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties

QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties

QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties quickperf.io 📙 Documentation Annotations

Dec 15, 2022

Some anti afk bot which prevents you from getting punished for going afk in games. Way of stopping the bot is slightly flawed but we'll ignore that.

Some anti afk bot which prevents you from getting punished for going afk in games. Way of stopping the bot is slightly flawed but we'll ignore that.

AntiAFK Some anti afk bot which prevents you from getting punished for going afk in games. Gui mode coming soon... Installation Install Java 17. Downl

Jan 13, 2022

An experimental mod that converts some block entities to blockstates. This is done for performance & functionality reasons.

An experimental mod that converts some block entities to blockstates. This is done for performance & functionality reasons.

BetterBlockStates An experimental mod that converts some block entities to blockstates. This is done for performance & functionality reasons. Current

Sep 17, 2022

Very briefly capturing some of new/ update in API that were introduced after Java 8 that may come handy for dev folks while programming

Very briefly capturing some of new/ update in API that were introduced after Java 8 that may come handy for dev folks while programming. Also have created tests demonstrating those APIs and playaround with it.

Jan 24, 2022

A proof-of-concept Android application to detect and defeat some of the Cellebrite UFED forensic toolkit extraction techniques.

LockUp An Android-based Cellebrite UFED self-defense application LockUp is an Android application that will monitor the device for signs for attempts

Dec 4, 2022

This is some Discord bot I made to help me learn Java. Not very useful yet.

JennyChan This is some Discord bot I made to help me learn Java. Not very useful yet. What it can do so far: Reply to mention List commands Show bot u

Sep 1, 2022

Some recent questions asked in interviews of companies like Google, TCS, Amazon etc.

Some recent questions asked in interviews of companies like Google, TCS, Amazon etc.

Nov 21, 2022

WaterCore - It's a Core, for SpigotPlugins, that contains some other API's

WaterCore - It's a Core, for SpigotPlugins, that contains some other API's (From other Developers)

May 9, 2022

Some DMOJ solutions mostly in Java and C++

Select DMOJ Solutions Select DMOJ solutions mostly in Java and C++ Most of these solutions are for 5 and 7 point problems There are also a lot of CCC

Oct 4, 2022
Releases(1.0)
Owner
ăȘるみ
ăȘるみ
A suite of software tools and services created to support activity planning and sequencing needs of missions with modeling, simulation, scheduling and validation capabilities

Aerie A suite of software tools and services created to support activity planning and sequencing needs of missions with modeling, simulation, scheduli

NASA Advanced Multi-Mission Operations System 31 Jan 3, 2023
A fast and reliable Java micro-library which chooses the sorting algorithm that best fits your needs and sorts the parameter.

A fast and reliable Java micro-library which chooses the sorting algorithm that best fits your needs and sorts the parameter.

Simone Nicol 2 Feb 19, 2022
Gradle plugin for Android applications for detecting unexpected changes in AndroidManifest.xml

manifest-guard Gradle plugin for Android applications for detecting unexpected changes in AndroidManifest.xml The problem being solved Every third-par

Daniil Popov 39 Dec 24, 2022
Weatherapp is a simple weather forecast app that uses some APIs to retrieve forecast data from OpenWeatherMap.

WeatherMobileApp Weatherapp is a simple weather forecast app that uses some APIs to retrieve forecast data from OpenWeatherMap. Table of Contents Tech

Mateusz Jasiak 1 Jan 17, 2022
Representational State Transfer + Structured Query Language(RSQL): Demo application using RSQL parser to filter records based on provided condition(s)

Representational State Transfer + Structured Query Language: RSQL Demo application using RSQL parser to filter records based on provided condition(s)

Hardik Singh Behl 9 Nov 23, 2022
A diagnostic library for parser / interpreter usages.

Nenggao Makes diagnostic easier! A diagnostic library for parser / interpreter usages. About Nenggao is a diagnostic library mainly designed for Yakou

ChAoS_UnItY 20 Nov 4, 2022
A React Native project starter with Typescript, a theme provider with hook to easy styling component, a folder architecture ready and some configs to keep a codebase clean.

React Native Boilerplate Folder structure : src ├── assets │   ├── audios │   ├── fonts │   ├── icons │   └── images ├── components │   ├── Layout.tsx

LazyRabbit 23 Sep 1, 2022
Provides some Apple Wallet functionality, like adding passes, removing passes and checking passises for existing.

react-native-wallet-manager Provides some Apple Wallet's functionality, like adding passes, removing passes and checking passises for existing. Instal

dev.family 50 Nov 12, 2022
Hi, Spring fans! In this installment, we're going to look at some the C in M-V-C and their representation in Spring's `@Controller` types!

@Controllers Hi, Spring fans! In this installment, we're going to look at some the C in M-V-C and their representation in Spring's @Controller types!

Spring Tips 22 Nov 19, 2022
Some tools to help mitigating Apache Log4j 2 CVE-2021-44228

JndiLookup Some tool to help analyzing Apache Log4j 2 CVE-2021-44228 This tool uses the "lookup" feature from log4j-2 to test against the JNDI vulnera

Daniel Fages 3 Dec 18, 2021