Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
287547b69e | |||
f4934225b6 | |||
69be8312f8 | |||
f083dcd3d8 | |||
44e955a047 | |||
c76140ffe1 | |||
a89e63f19f | |||
0ea49ff1ad | |||
325c6c25d7 |
118
.github/workflows/binary-release.yml
vendored
Normal file
118
.github/workflows/binary-release.yml
vendored
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
name: binary release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '[0-9]+.[0-9]+.[0-9]+'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Get the version
|
||||||
|
id: get_version
|
||||||
|
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
|
||||||
|
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: '1.13.0'
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: make -j $(nproc) compile VERSION=${{ steps.get_version.outputs.VERSION }}
|
||||||
|
|
||||||
|
- name: create release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@latest
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ steps.get_version.outputs.VERSION }}
|
||||||
|
release_name: Release ${{ steps.get_version.outputs.VERSION }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
|
||||||
|
- name: darwin-386
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./bin/${{ github.event.repository.name }}-darwin-386
|
||||||
|
asset_name: ${{ github.event.repository.name }}-darwin-386
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: darwin-amd64
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./bin/${{ github.event.repository.name }}-darwin-amd64
|
||||||
|
asset_name: ${{ github.event.repository.name }}-darwin-amd64
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: freebsd-386
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./bin/${{ github.event.repository.name }}-freebsd-386
|
||||||
|
asset_name: ${{ github.event.repository.name }}-freebsd-386
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: freebsd-amd64
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./bin/${{ github.event.repository.name }}-freebsd-amd64
|
||||||
|
asset_name: ${{ github.event.repository.name }}-freebsd-amd64
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: linux-386
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./bin/${{ github.event.repository.name }}-linux-386
|
||||||
|
asset_name: ${{ github.event.repository.name }}-linux-386
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: linux-amd64
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./bin/${{ github.event.repository.name }}-linux-amd64
|
||||||
|
asset_name: ${{ github.event.repository.name }}-linux-amd64
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: windows-386
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./bin/${{ github.event.repository.name }}-windows-386.exe
|
||||||
|
asset_name: ${{ github.event.repository.name }}-windows-386.exe
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: windows-amd64
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./bin/${{ github.event.repository.name }}-windows-amd64.exe
|
||||||
|
asset_name: ${{ github.event.repository.name }}-windows-amd64.exe
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
23
.github/workflows/build.yml
vendored
Normal file
23
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
name: build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: '1.13.0'
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: make -j $(nproc)
|
||||||
|
|
36
Makefile
36
Makefile
@ -1,21 +1,30 @@
|
|||||||
NAME=multini
|
NAME = multini
|
||||||
VERSION=0.2
|
VERSION = dev_$(shell date +%F_%T)
|
||||||
GOCMD=go
|
GOCMD = go
|
||||||
LDFLAGS:="$(LDFLAGS) -X 'main.Version=$(VERSION)'"
|
LDFLAGS := "$(LDFLAGS) -X 'main.Version=$(VERSION)'"
|
||||||
GOBUILD=$(GOCMD) build -ldflags=$(LDFLAGS)
|
GOBUILD = $(GOCMD) build -ldflags=$(LDFLAGS)
|
||||||
SRCMAIN=.
|
SRCMAIN = ./cmd/$(NAME)
|
||||||
BINDIR=bin
|
SRCDOC = ./doc
|
||||||
BIN=$(BINDIR)/$(NAME)
|
SRCTEST = ./test
|
||||||
README=README
|
BINDIR = bin
|
||||||
LICENSE=LICENSE
|
BIN = $(BINDIR)/$(NAME)
|
||||||
TEST=./run_test.sh
|
README = $(SRCDOC)/README
|
||||||
PREFIX=/usr
|
LICENSE = LICENSE
|
||||||
|
TEST = $(SRCTEST)/run_test.sh
|
||||||
|
PREFIX = /usr
|
||||||
|
|
||||||
|
.PHONY: all prep doc build check-build freebsd-386 darwin-386 linux-386 windows-386 freebsd-amd64 darwin-amd64 linux-amd64 windows-amd64 compile install check-install uninstall clean test
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
prep: clean
|
prep: clean
|
||||||
|
go mod init; go mod tidy
|
||||||
mkdir $(BINDIR)
|
mkdir $(BINDIR)
|
||||||
|
|
||||||
|
doc: check-build
|
||||||
|
test -d $(SRCDOC) || mkdir $(SRCDOC)
|
||||||
|
$(BIN) --help > $(README)
|
||||||
|
|
||||||
build: prep
|
build: prep
|
||||||
$(GOBUILD) -o $(BIN) $(SRCMAIN)
|
$(GOBUILD) -o $(BIN) $(SRCMAIN)
|
||||||
|
|
||||||
@ -48,7 +57,7 @@ windows-amd64: prep
|
|||||||
|
|
||||||
compile: freebsd-386 darwin-386 linux-386 windows-386 freebsd-amd64 darwin-amd64 linux-amd64 windows-amd64
|
compile: freebsd-386 darwin-386 linux-386 windows-386 freebsd-amd64 darwin-amd64 linux-amd64 windows-amd64
|
||||||
|
|
||||||
install: check-build
|
install: check-build doc
|
||||||
install -m 755 -d $(PREFIX)/bin/
|
install -m 755 -d $(PREFIX)/bin/
|
||||||
install -m 755 $(BIN) $(PREFIX)/bin/
|
install -m 755 $(BIN) $(PREFIX)/bin/
|
||||||
install -m 755 -d $(PREFIX)/share/licenses/$(NAME)/
|
install -m 755 -d $(PREFIX)/share/licenses/$(NAME)/
|
||||||
@ -71,3 +80,4 @@ clean:
|
|||||||
|
|
||||||
test: check-build
|
test: check-build
|
||||||
$(TEST) $(BIN)
|
$(TEST) $(BIN)
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"multini/output"
|
"multini/internal/output"
|
||||||
"multini/types"
|
"multini/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func chk() int {
|
func chk() int {
|
@ -4,8 +4,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"multini/output"
|
"multini/internal/output"
|
||||||
"multini/types"
|
"multini/internal/types"
|
||||||
|
|
||||||
"github.com/juju/gnuflag"
|
"github.com/juju/gnuflag"
|
||||||
)
|
)
|
||||||
@ -100,7 +100,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func parseArgs() error {
|
func parseArgs() error {
|
||||||
gnuflag.Parse(true)
|
gnuflag.Parse(false)
|
||||||
|
|
||||||
// info
|
// info
|
||||||
switch {
|
switch {
|
@ -3,8 +3,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"multini/output"
|
"multini/internal/output"
|
||||||
"multini/types"
|
"multini/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
@ -7,8 +7,8 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"multini/output"
|
"multini/internal/output"
|
||||||
"multini/types"
|
"multini/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -26,15 +26,15 @@ var (
|
|||||||
|
|
||||||
RxBodyPrefix string = `(?P<` + NgPrefix + `>\s+)?`
|
RxBodyPrefix string = `(?P<` + NgPrefix + `>\s+)?`
|
||||||
RxSectionName string = `\[(?P<` + NgSection + `>.+)\]`
|
RxSectionName string = `\[(?P<` + NgSection + `>.+)\]`
|
||||||
RxKey string = `(?P<` + NgKey + `>(?:[^;#=]+[^\s=;#]|[^;#=]))?`
|
RxKey string = `(?P<` + NgKey + `>(?:[^;#/=]+[^\s=;#/]|[^;#/=]))?`
|
||||||
RxKeyPostfix string = `(?P<` + NgKeyPostfix + `>\s+)?`
|
RxKeyPostfix string = `(?P<` + NgKeyPostfix + `>\s+)?`
|
||||||
RxValuePrefix string = `(?P<` + NgValuePrefix + `>\s+)?`
|
RxValuePrefix string = `(?P<` + NgValuePrefix + `>\s+)?`
|
||||||
RxValue string = `(?P<` + NgValue + `>(?:[^;#]+[^\s;#]|[^;#]))?`
|
RxValue string = `(?P<` + NgValue + `>(?:[^;#/]+[^\s;#/]|[^;#/]))?`
|
||||||
RxValuePostfix string = `(?P<` + NgValuePostfix + `>\s+)?`
|
RxValuePostfix string = `(?P<` + NgValuePostfix + `>\s+)?`
|
||||||
RxKeyVal string = RxKey + RxKeyPostfix + `=` + RxValuePrefix + RxValue + RxValuePostfix
|
RxKeyVal string = RxKey + RxKeyPostfix + `=` + RxValuePrefix + RxValue + RxValuePostfix
|
||||||
RxBody string = `(?:` + RxSectionName + `|` + RxKeyVal + `)?`
|
RxBody string = `(?:` + RxSectionName + `|` + RxKeyVal + `)?`
|
||||||
RxBodyPostfix string = `(?P<` + NgPostifx + `>\s+)?`
|
RxBodyPostfix string = `(?P<` + NgPostifx + `>\s+)?`
|
||||||
RxCommentPrefix string = `(?P<` + NgCommentPrefix + `>[#;]\s*)`
|
RxCommentPrefix string = `(?P<` + NgCommentPrefix + `>([#;]|//)\s*)`
|
||||||
RxCommentText string = `(?P<` + NgComment + `>.+)?`
|
RxCommentText string = `(?P<` + NgComment + `>.+)?`
|
||||||
RxComment string = `(?:` + RxCommentPrefix + RxCommentText + `)?`
|
RxComment string = `(?:` + RxCommentPrefix + RxCommentText + `)?`
|
||||||
Rx string = RxBodyPrefix + RxBody + RxBodyPostfix + RxComment
|
Rx string = RxBodyPrefix + RxBody + RxBodyPostfix + RxComment
|
@ -2,13 +2,55 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"multini/types"
|
"multini/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Source: https://gist.github.com/var23rav/23ae5d0d4d830aff886c3c970b8f6c6b
|
||||||
|
/*
|
||||||
|
GoLang: os.Rename() give error "invalid cross-device link" for Docker container with Volumes.
|
||||||
|
MoveFile(source, destination) will work moving file between folders
|
||||||
|
*/
|
||||||
|
func tryMoveFile(sourcePath, destPath string) error {
|
||||||
|
inputFile, err := os.Open(sourcePath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
outputFile, err := os.Create(destPath)
|
||||||
|
if err != nil {
|
||||||
|
inputFile.Close()
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer outputFile.Close()
|
||||||
|
_, err = io.Copy(outputFile, inputFile)
|
||||||
|
inputFile.Close()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// The copy was successful, so now delete the original file
|
||||||
|
err = os.Remove(sourcePath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func tryRemoveRenameFile(sourcePath, destPath string) bool {
|
||||||
|
err := os.Remove(destPath)
|
||||||
|
if err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
err = os.Rename(sourcePath, destPath)
|
||||||
|
if err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func replaceOriginal(oldFile, newFile string) error {
|
func replaceOriginal(oldFile, newFile string) error {
|
||||||
realOldFile, err := filepath.EvalSymlinks(oldFile)
|
realOldFile, err := filepath.EvalSymlinks(oldFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -23,14 +65,11 @@ func replaceOriginal(oldFile, newFile string) error {
|
|||||||
|
|
||||||
var uid, gid int = GetUidGid(infoOldFile)
|
var uid, gid int = GetUidGid(infoOldFile)
|
||||||
|
|
||||||
err = os.Remove(realOldFile)
|
if !tryRemoveRenameFile(newFile, realOldFile) {
|
||||||
if err != nil {
|
err = tryMoveFile(newFile, realOldFile)
|
||||||
return err
|
if err != nil {
|
||||||
}
|
return err
|
||||||
|
}
|
||||||
err = os.Rename(newFile, realOldFile)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = os.Chmod(realOldFile, mode)
|
err = os.Chmod(realOldFile, mode)
|
||||||
@ -75,7 +114,7 @@ func iniWriteInplace(filename string, ini *types.Ini) error {
|
|||||||
}
|
}
|
||||||
mode = info.Mode()
|
mode = info.Mode()
|
||||||
}
|
}
|
||||||
targetFile, err := os.OpenFile(realfilename, os.O_WRONLY|os.O_CREATE, mode)
|
targetFile, err := os.OpenFile(realfilename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, mode)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
datawriter := bufio.NewWriter(targetFile)
|
datawriter := bufio.NewWriter(targetFile)
|
||||||
_, err = datawriter.WriteString(ini.Full())
|
_, err = datawriter.WriteString(ini.Full())
|
5
go.mod
Normal file
5
go.mod
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
module multini
|
||||||
|
|
||||||
|
go 1.13
|
||||||
|
|
||||||
|
require github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d
|
2
go.sum
Normal file
2
go.sum
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d h1:c93kUJDtVAXFEhsCh5jSxyOJmFHuzcihnslQiX8Urwo=
|
||||||
|
github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE=
|
@ -89,6 +89,14 @@ func (obj *Ini) GetKeyVal(section, key, value string) error {
|
|||||||
func (obj *Ini) AddSection(section string) *Section {
|
func (obj *Ini) AddSection(section string) *Section {
|
||||||
sect, err := obj.FindSection(section)
|
sect, err := obj.FindSection(section)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
sectSize := len(obj.Sections)
|
||||||
|
if sectSize > 1 {
|
||||||
|
prevSect := obj.Sections[sectSize-1].(*Section)
|
||||||
|
lineSize := len(prevSect.Lines)
|
||||||
|
if lineSize == 0 || lineSize > 0 && prevSect.Lines[lineSize-1].Type() != TEmptyLine {
|
||||||
|
obj.Sections[sectSize-1].(*Section).Lines = append(obj.Sections[sectSize-1].(*Section).Lines, &EmptyLine{})
|
||||||
|
}
|
||||||
|
}
|
||||||
var newSection Section
|
var newSection Section
|
||||||
newSection.Name = section
|
newSection.Name = section
|
||||||
newSection.Prefix = obj.Sections[len(obj.Sections)-1].Indent()
|
newSection.Prefix = obj.Sections[len(obj.Sections)-1].Indent()
|
@ -10,7 +10,7 @@ DefKey3=NoSpaces!
|
|||||||
Key2 = 2
|
Key2 = 2
|
||||||
Key3 = 3
|
Key3 = 3
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
||||||
@ -17,4 +17,5 @@ DefKey3=NoSpaces!
|
|||||||
[SectionWithIndent]
|
[SectionWithIndent]
|
||||||
Key=Value
|
Key=Value
|
||||||
[SectionWithoutNewLineBefore]
|
[SectionWithoutNewLineBefore]
|
||||||
|
|
||||||
[NewSection]
|
[NewSection]
|
@ -8,7 +8,7 @@ DefKey3=NoSpaces!
|
|||||||
[SimpleSection] # Comment For Section
|
[SimpleSection] # Comment For Section
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
|
|
||||||
[SectionWithIndent]
|
[SectionWithIndent]
|
||||||
Key=Value
|
Key=Value
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 3
|
Key = 3
|
||||||
|
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = onlyone
|
Key = onlyone
|
||||||
|
|
||||||
[SectionWithIndent]
|
[SectionWithIndent]
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -9,7 +9,7 @@ DefKey3=NoSpaces!
|
|||||||
Key1 = 1
|
Key1 = 1
|
||||||
Key2 = 2
|
Key2 = 2
|
||||||
|
|
||||||
[MultipleKeySection]
|
[MultipleKeySection] // C style comment
|
||||||
Key = 1
|
Key = 1
|
||||||
Key = 2
|
Key = 2
|
||||||
Key = 3
|
Key = 3
|
@ -1,10 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DEF='\e[0m'; BLD='\e[1m'; RED='\e[31m'; GRN='\e[32m'; WHT='\e[97m'
|
DEF='\e[0m'; BLD='\e[1m'; RED='\e[31m'; GRN='\e[32m'; WHT='\e[97m'
|
||||||
|
|
||||||
ScriptFullname=$(readlink -e "$0")
|
ScriptFullname=$(readlink -e "$0")
|
||||||
ScriptName=$(echo "$ScriptFullname" | awk -F '/' '{print $NF;}')
|
ScriptName=$(echo "$ScriptFullname" | awk -F '/' '{print $NF;}')
|
||||||
ScriptDir=$(dirname "$ScriptFullname")
|
ScriptDir=$(dirname "$ScriptFullname")
|
||||||
TestDir="$ScriptDir/tests"
|
TestDir="$ScriptDir/data"
|
||||||
Multini=$(readlink -e "$1")
|
Multini=$(readlink -e "$1")
|
||||||
|
|
||||||
if [[ -z "$Multini" ]]; then
|
if [[ -z "$Multini" ]]; then
|
Reference in New Issue
Block a user